Skip to content

Commit

Permalink
refactor REoptLite -> REopt
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Laws committed Jan 27, 2022
1 parent 967fdb2 commit f0985a5
Show file tree
Hide file tree
Showing 19 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
- name: Build containers
run: docker-compose up -d
- name: Execute tests in container
run: docker exec jul julia --project=. -e 'import Pkg; Pkg.test("REoptLite"; test_args=["Xpress"])'
run: docker exec jul julia --project=. -e 'import Pkg; Pkg.test("REopt"; test_args=["Xpress"])'
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# REoptLite Changelog
# REopt Changelog

## v0.12.3
- add utils for PVwatts: `get_ambient_temperature` and `get_pvwatts_prodfactor`
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "REoptLite"
uuid = "0144022d-7626-48b7-867b-06d945449d75"
name = "REopt"
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
authors = ["Nick Laws <[email protected]>"]
version = "0.12.3"

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# REoptLite Julia package
# REopt Julia package
This package is currently under development and only has a subset of capabilities of the REopt Lite model used in the [REopt Lite API](https://github.com/NREL/REopt_Lite_API). For example, the CHP model and thermal loads are not yet modeled in this code. However this code is easier to use than the API (only dependencies are Julia and a solver) and has a novel model for uncertain outages.

Note: this package has been tested with Julia 1.4, 1.5, and 1.6 and may not be compatible with older versions.

For more information please see the documentation:
<!-- [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://nrel.github.io/REoptLite.jl/stable) -->
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://nrel.github.io/REoptLite/dev)
<!-- [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://nrel.github.io/REopt.jl/stable) -->
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://nrel.github.io/REopt/dev)


## Uncertain outages
Expand All @@ -17,11 +17,11 @@ Evaluating only `PV` and `Storage` requires a linear program solver. Adding a ge
```
using Xpress
using JuMP
using REoptLite
using REopt
m = Model(Xpress.Optimizer)
results = run_reopt(m, "path/to/scenario.json")
```
See the `test/scenarios` directory for examples of `scenario.json`.

For more details see the [documentation](https://nrel.github.io/REoptLite/dev).
For more details see the [documentation](https://nrel.github.io/REopt/dev).
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
REoptLite = "0144022d-7626-48b7-867b-06d945449d75"
REopt = "0144022d-7626-48b7-867b-06d945449d75"

[compat]
Documenter = "0.26"
12 changes: 6 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

## Hosting documentation locally
You must `Pkg.dev REoptLite` in the docs Project for the docs to update using the following method. The python server does not pick up on changes dynamically so the process below must be repeated to show changes.
You must `Pkg.dev REopt` in the docs Project for the docs to update using the following method. The python server does not pick up on changes dynamically so the process below must be repeated to show changes.
```bash
[~/.julia/dev/REoptLite/docs]
[~/.julia/dev/REopt/docs]
nlaws-> rm -rf build/

[~/.julia/dev/REoptLite/docs]
[~/.julia/dev/REopt/docs]
nlaws-> julia --project=. make.jl
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
Expand All @@ -18,17 +18,17 @@ nlaws-> julia --project=. make.jl
┌ Warning: Documenter could not auto-detect the building environment Skipping deployment.
└ @ Documenter ~/.julia/packages/Documenter/bFHi4/src/deployconfig.jl:75

[~/.julia/dev/REoptLite/docs]
[~/.julia/dev/REopt/docs]
nlaws-> cd build/

[~/.julia/dev/REoptLite/docs/build]
[~/.julia/dev/REopt/docs/build]
nlaws-> python3 -m http.server --bind localhost
Serving HTTP on ::1 port 8000 (http://[::1]:8000/) ...
```
Alternatively, you can use `LiveServer.jl` to host the documentation locally:
```julia
[~/.julia/dev/REoptLite/docs]
[~/.julia/dev/REopt/docs]
nlaws-> julia --project=.
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
Expand Down
6 changes: 3 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Documenter, REoptLite, JuMP
using Documenter, REopt, JuMP

makedocs(
sitename="REoptLite.jl Documentation",
sitename="REopt.jl Documentation",
pages = [
"Home" => "index.md",
"REopt Lite" => Any[
Expand All @@ -26,5 +26,5 @@ makedocs(
)

deploydocs(
repo = "github.com/NREL/REoptLite.git",
repo = "github.com/NREL/REopt.git",
)
6 changes: 3 additions & 3 deletions docs/src/developer/adding_tech.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ From the load balance constraint we can see that the `PV` technology (and each `
The `p.techs` data structure is defined as follows:
### Techs
```@docs
REoptLite.Techs
REoptLite.Techs(s::Scenario)
REoptLite.Techs(p::REoptInputs, s::BAUScenario)
REopt.Techs
REopt.Techs(s::Scenario)
REopt.Techs(p::REoptInputs, s::BAUScenario)
```

From the [Techs](@ref) definition we can see that there are already a lot of different energy generation technology categories in REopt. Adding a new technology to the model could be as simple as adding the appropriate inputs to `REoptInputs` (described in the next section) and using the `Techs` structure to define which variables and constraints apply to the new technology.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/developer/concept.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
At a high level each REopt model consists of four major components:
1. The [Scenario](@ref) as defined by the user's inputs and default values.
2. The [REoptInputs](@ref), which convert the `Scenario` into the necessary values for the REopt mathematical program.
3. The REopt Model (built [here](https://github.com/NREL/REoptLite/blob/master/src/core/reopt.jl)), which includes all the constraints and the objective function that are built using the [REoptInputs](@ref)
4. And the [results](https://github.com/NREL/REoptLite/blob/master/src/results/results.jl), which are returned to the user and derived from the optimal solution of the REopt Model.
3. The REopt Model (built [here](https://github.com/NREL/REopt/blob/master/src/core/reopt.jl)), which includes all the constraints and the objective function that are built using the [REoptInputs](@ref)
4. And the [results](https://github.com/NREL/REopt/blob/master/src/results/results.jl), which are returned to the user and derived from the optimal solution of the REopt Model.

The REopt Model is built via the [build_reopt!](@ref) method. However, the [run_reopt](@ref) method includes `build_reopt!` within it so typically a user does not need to directly call `build_reopt!` (unless they wish to modify the model before solving it, eg. by adding a constraint).

Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer/inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The REoptInputs structure uses the [Scenario](@ref) to build all of the data nec
```@docs
REoptInputs
REoptInputs(fp::String)
REoptInputs(s::REoptLite.AbstractScenario)
REoptInputs(s::REopt.AbstractScenario)
```

## Design Concepts for REoptInputs
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# REoptLite.jl
# REopt.jl
*Renewable Energy Optimization and Integration*

!!! note
Expand All @@ -7,5 +7,5 @@
## Installing
```julia
using Pkg
Pkg.add("REoptLite")
Pkg.add("REopt")
```
6 changes: 3 additions & 3 deletions docs/src/mpc/examples.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# MPC Examples
The MPC capability provided by `REoptLite` is essentially the optimal sizing and dispatch capability that `REoptLite` is commonly used for, but with the sizing problem removed. Also, the MPC model can be built for an arbitrary time length, or "horizon" (whereas a `REoptLite` model always includes an entire calendar year). The MPC model also requires the user to provide load and resource forecasts as inputs (whereas the typical `REoptLite` model allows one to use built-in load profiles as well as other API's such as PVWatts for the solar resource).
The MPC capability provided by `REopt` is essentially the optimal sizing and dispatch capability that `REopt` is commonly used for, but with the sizing problem removed. Also, the MPC model can be built for an arbitrary time length, or "horizon" (whereas a `REopt` model always includes an entire calendar year). The MPC model also requires the user to provide load and resource forecasts as inputs (whereas the typical `REopt` model allows one to use built-in load profiles as well as other API's such as PVWatts for the solar resource).

```julia
using REoptLite, JuMP, Cbc
using REopt, JuMP, Cbc
model = Model(Cbc.Optimizer)
results = run_mpc(model, "./test/scenarios/mpc.json")
```
See [mpc.json](https://github.com/NREL/REoptLite/blob/master/test/scenarios/mpc.json) for details on the Scenario.
See [mpc.json](https://github.com/NREL/REopt/blob/master/test/scenarios/mpc.json) for details on the Scenario.
12 changes: 6 additions & 6 deletions docs/src/mpc/inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,32 +150,32 @@ Note that the keys of the input `Dict` or JSON file do not need the `MPC` prefix

## MPCElectricTariff
```@docs
REoptLite.MPCElectricTariff(d::Dict)
REopt.MPCElectricTariff(d::Dict)
```

## MPCElectricLoad
```@docs
REoptLite.MPCElectricLoad
REopt.MPCElectricLoad
```

## MPCElecStorage
```@docs
REoptLite.MPCElecStorage
REopt.MPCElecStorage
```

## MPCFinancial
```@docs
REoptLite.MPCFinancial
REopt.MPCFinancial
```

## MPCPV
```@docs
REoptLite.MPCPV
REopt.MPCPV
```

## MPCGenerator
```@docs
REoptLite.MPCGenerator
REopt.MPCGenerator
```

## MPCSettings
Expand Down
8 changes: 4 additions & 4 deletions docs/src/reopt/examples.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Examples
To use REopt Lite you will need to have a solver installed. REoptLite.jl has been tested with Xpress, Cbc, and CPLEX solvers, but it should work with other Linear Progam solvers (for PV and Storage scenarios) or Mixed Integer Linear Program solvers (for scenarios with outages and/or Generators).
To use REopt Lite you will need to have a solver installed. REopt.jl has been tested with Xpress, Cbc, and CPLEX solvers, but it should work with other Linear Progam solvers (for PV and Storage scenarios) or Mixed Integer Linear Program solvers (for scenarios with outages and/or Generators).

## Basic
```julia
using REoptLite, JuMP, Cbc
using REopt, JuMP, Cbc

m = Model(Cbc.Optimizer)
results = run_reopt(m, "test/scenarios/pv_storage.json")
```
See [pv_storage.json](https://github.com/NREL/REoptLite/blob/master/test/scenarios/pv_storage.json) for details on the Scenario.
See [pv_storage.json](https://github.com/NREL/REopt/blob/master/test/scenarios/pv_storage.json) for details on the Scenario.

For more on the `scenario.json` see the [REopt Inputs](@ref) section.

Expand All @@ -31,7 +31,7 @@ In the following example we add a cost for curtailed PV power.
```julia
using Xpress
using JuMP
using REoptLite
using REopt

m = JuMP.Model(Xpress.Optimizer)

Expand Down
34 changes: 17 additions & 17 deletions docs/src/reopt/inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Inputs to `run_reopt` can be provided in one of three formats:
1. a file path (string) to a JSON file,
2. a `Dict`, or
3. using the `REoptInputs` struct
Any one of these types can be passed to the [`run_reopt`](https://nrel.github.io/REoptLite/stable/reopt/methods/#run_reopt) method.
Any one of these types can be passed to the [`run_reopt`](https://nrel.github.io/REopt/stable/reopt/methods/#run_reopt) method.

The first option is perhaps the most straightforward one. For example, the minimum requirements for a JSON scenario file would look like:
```javascript
Expand Down Expand Up @@ -40,7 +40,7 @@ To add PV to the analysis simply add a PV key with an empty dictionary (to use d
"PV": {}
}
```
This scenario will consider the option to purchase a solar PV system to reduce energy costs, and if solar PV can reduce the energy costs then REopt Lite will provide the optimal PV capacity (assuming perfect foresight!). To use other than default values for `PV` see the [PV struct definition](https://github.com/NREL/REoptLite/blob/master/src/core/pv.jl). For example, the site under consideration might have some existing PV capacity to account for, which can be done by setting the `existing_kw` key to the appropriate value.
This scenario will consider the option to purchase a solar PV system to reduce energy costs, and if solar PV can reduce the energy costs then REopt Lite will provide the optimal PV capacity (assuming perfect foresight!). To use other than default values for `PV` see the [PV struct definition](https://github.com/NREL/REopt/blob/master/src/core/pv.jl). For example, the site under consideration might have some existing PV capacity to account for, which can be done by setting the `existing_kw` key to the appropriate value.

## Scenario
The `Scenario` struct captures all of the objects that can be included in a scenario.json:
Expand All @@ -57,71 +57,71 @@ BAUScenario

## Site
```@docs
REoptLite.Site
REopt.Site
```

## ElectricLoad
```@docs
REoptLite.ElectricLoad
REopt.ElectricLoad
```

## ElectricTariff
```@docs
REoptLite.ElectricTariff
REoptLite.ElectricTariff()
REopt.ElectricTariff
REopt.ElectricTariff()
```

## Financial
```@docs
REoptLite.Financial
REopt.Financial
```

## ElectricUtility
```@docs
REoptLite.ElectricUtility
REopt.ElectricUtility
```

## PV
```@docs
REoptLite.PV
REopt.PV
```

## Storage
```@docs
REoptLite.ElecStorage
REopt.ElecStorage
```

## Wind
```@docs
REoptLite.Wind
REopt.Wind
```

## Generator
```@docs
REoptLite.Generator
REopt.Generator
```

## DomesticHotWaterLoad
```@docs
REoptLite.DomesticHotWaterLoad
REopt.DomesticHotWaterLoad
```

## SpaceHeatingLoad
```@docs
REoptLite.SpaceHeatingLoad
REopt.SpaceHeatingLoad
```

## ExistingBoiler
```@docs
REoptLite.ExistingBoiler
REopt.ExistingBoiler
```

## CHP
```@docs
REoptLite.CHP
REopt.CHP
```

## Settings
```@docs
REoptLite.Settings
REopt.Settings
```
Loading

0 comments on commit f0985a5

Please sign in to comment.