Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ permissions:
# on the other workflows that reutilize the Python environment
env:
CACHE_NUMBER: 1
JULIA_VERSION: '1.12.1'

jobs:
python-cache:
Expand Down Expand Up @@ -58,6 +59,8 @@ jobs:
restore-keys: julia-${{ runner.os }}-

- uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71 # v2
with:
version: ${{ env.JULIA_VERSION }}
env:
NODE_EXTRA_CA_CERTS: /usr/local/share/ca-certificates/nrel_ca_chain.crt

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/python-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defaults:

env:
CACHE_NUMBER: 1
JULIA_VERSION: '1.12.1'
REEDS_ENV_NAME: reeds2

jobs:
Expand All @@ -43,6 +44,8 @@ jobs:
restore-keys: julia-${{ runner.os }}-

- uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71 # v2
with:
version: ${{ env.JULIA_VERSION }}
env:
NODE_EXTRA_CA_CERTS: /usr/local/share/ca-certificates/nrel_ca_chain.crt

Expand Down Expand Up @@ -198,6 +201,8 @@ jobs:

- uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71 # v2
id: setup-julia
with:
version: ${{ env.JULIA_VERSION }}
env:
NODE_EXTRA_CA_CERTS: /usr/local/share/ca-certificates/nrel_ca_chain.crt

Expand Down
9 changes: 7 additions & 2 deletions Project.toml
Comment thread
sriharisundar marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
PRAS = "05348d26-1c52-11e9-35e3-9d51842d34b9"
PRASCore = "c5c32b99-e7c3-4530-a685-6f76e19f7fe2"
PRASFiles = "a2806276-6d43-4ef5-91c0-491704cd7cf1"
Random123 = "74087812-796a-5b5d-8853-05524746bad3"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
Expand All @@ -21,5 +23,8 @@ HDF5 = "0.16.15"
InlineStrings = "1.4.0"
JSON = "0.21.4"
LoggingExtras = "1.0.3"
PRAS = "0.6.3"
TimeZones = "~1.13.0"
PRAS = "~0.8.0"
PRASCore = "~0.8.0"
PRASFiles = "~0.8.0"
TimeZones = "^1.13.0"
julia = "=1.12.1"
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
**Regional Energy Deployment System (ReEDS) Model**


[![CI](https://github.nrel.gov/ReEDS/ReEDS-2.0/actions/workflows/python-app.yaml/badge.svg)](https://github.nrel.gov/ReEDS/ReEDS-2.0/actions/workflows/python-app.yaml)
[![Documentation](https://img.shields.io/badge/Documentation-view%20online-0a7f5e?logo=readthedocs&logoColor=white&labelColor=555)](https://natlabrockies.github.io/ReEDS-2.0)
[![CI](https://github.com/ReEDS-Model/ReEDS/actions/workflows/python-app.yaml/badge.svg?branch=main)](https://github.com/ReEDS-Model/ReEDS/actions/workflows/python-app.yaml)
[![Documentation](https://img.shields.io/badge/Documentation-view%20online-0a7f5e?logo=readthedocs&logoColor=white&labelColor=555)](https://reeds-model.github.io/ReEDS)
![Static Badge](https://img.shields.io/badge/python-3.11-blue)
![GitHub License](https://img.shields.io/github/license/NatLabRockies/ReEDS-2.0)
![GitHub License](https://img.shields.io/github/license/ReEDS-Model/ReEDS)
[![DOI](https://zenodo.org/badge/189060033.svg)](https://doi.org/10.5281/zenodo.16943302)

</br>
Expand All @@ -15,7 +15,7 @@ This GitHub repository contains the source code for NLR's ReEDS model.
The ReEDS model source code is available at no cost from the National Laboratory of the Rockies.
The ReEDS model can be downloaded or cloned from [https://github.com/ReEDS-Model/ReEDS](https://github.com/ReEDS-Model/ReEDS).

**For more information about the model, see the [open source ReEDS-2.0 Documentation](https://reeds-model.github.io/ReEDS).**
**For more information about the model, see the [ReEDS Documentation](https://reeds-model.github.io/ReEDS).**

ReEDS training videos are available on the [NLR Learning YouTube channel](https://youtube.com/playlist?list=PLmIn8Hncs7bG558qNlmz2QbKhsv7QCKiC&si=NgGBaL_MxNcYiIEX).

Expand All @@ -25,10 +25,10 @@ ReEDS training videos are available on the [NLR Learning YouTube channel](https:

## Introduction

[ReEDS](https://www.nrel.gov/analysis/reeds/) is a capacity planning and dispatch model for the U.S. electricity system.
[ReEDS](https://www.nlr.gov/analysis/reeds/) is a capacity planning and dispatch model for the U.S. electricity system.

As NLR's flagship long-term power sector model, ReEDS has served as the primary analytic tool for [many studies](https://natlabrockies.github.io/ReEDS-2.0/publications.html) of electricity sector research questions.
Example model results are available in the [Scenario Viewer](https://scenarioviewer.nrel.gov/).
As NLR's flagship long-term power sector model, ReEDS has served as the primary analytic tool for [many studies](https://reeds-model.github.io/ReEDS/publications.html) of electricity sector research questions.
Example model results are available in the [Scenario Viewer](https://scenarioviewer.nlr.gov/).



Expand All @@ -40,25 +40,28 @@ Example model results are available in the [Scenario Viewer](https://scenariovie
The ReEDS model is written in [Python](https://www.python.org/), [GAMS](https://www.gams.com/), and [Julia](https://julialang.org/).
Python and Julia are free, open-source languages;
GAMS requires a software license from the vendor.
A step-by-step guide for getting started with ReEDS is available [here](https://pages.github.nrel.gov/ReEDS/ReEDS-2.0/setup.html), and a quick-start guide for advanced users is outlined below.
A step-by-step guide for getting started with ReEDS is available [here](https://reeds-model.github.io/ReEDS/setup.html), and a quick-start guide for advanced users is outlined below.

1. Install Python using the Anaconda Distribution: <https://www.anaconda.com/download/success>
2. Set up GAMS:
1. Install GAMS: <https://www.gams.com/download/>
2. Obtain a combined GAMS/CPLEX license: <https://www.gams.com/sales/licensing/>
1. Small ReEDS systems have been solved using the open-source [COIN-OR](https://www.coin-or.org/) solver as described [here](https://www.nrel.gov/docs/fy21osti/77907.pdf), but this capability is not actively maintained.
1. Small ReEDS systems have been solved using the open-source [COIN-OR](https://www.coin-or.org/) solver as described [here](https://www.nlr.gov/docs/fy21osti/77907.pdf), but this capability is not actively maintained.
2. Other commercial solvers have also been successfully applied to ReEDS, but setup details and some solver tuning are specific to the CPLEX solver.
3. Install Julia: <https://julialang.org/downloads/>
3. Install Julia version 1.12.1 as described in the [documentation](https://reeds-model.github.io/ReEDS/setup.html#reeds2pras-julia-and-stress-periods-setup):
1. Follow the platform-dependent installation instructions at <https://julialang.org/downloads/> to install both `julia` and `juliaup`
2. Specify version 1.12.1 by running:
1. `juliaup add 1.12.1`
2. `juliaup default 1.12.1`
4. Open a command-line interface and set up your environments:
1. Clone the ReEDS repository: `git clone git@github.com:NatLabRockies/ReEDS-2.0.git` or `git clone https://github.com/NatLabRockies/ReEDS-2.0.git`
1. Clone the ReEDS repository: `git clone git@github.com:ReEDS-Model/ReEDS.git` or `git clone https://github.com/ReEDS-Model/ReEDS.git`
2. Navigate to the cloned repository
3. Create the `reeds2` [conda environment](https://docs.conda.io/projects/conda/en/stable/user-guide/tasks/manage-environments.html): `conda env create -f environment.yml`
1. Linux and Mac users can use the environment.yml directly. Windows users need to comment out the `- julia=1.8` line from the environment.yml file before creating the environment and use the version of Julia installed above.
4. Activate the `reeds2` environment: `conda activate reeds2`
5. Instantiate the Julia environment: `julia --project=. instantiate.jl`
6. (Optional) Several large data files are hosted remotely.
These files are downloaded automatically as needed during a ReEDS run, but to finish all the internet-requiring steps up front, you can download them all by running `python reeds/remote.py`.
Additional details on remote files and other topics can be found in the [user guide](https://pages.github.nrel.gov/ReEDS/ReEDS-2.0/user_guide.html#large-input-files).
Additional details on remote files and other topics can be found in the [user guide](https://reeds-model.github.io/ReEDS/user_guide.html#large-input-files).
5. Run ReEDS on a test case from the root of the cloned repository:
1. For interactive setup: `python runbatch.py`
2. For one-line operation: `python runbatch.py -b v20250314_main -c test`.
Expand All @@ -72,4 +75,4 @@ A step-by-step guide for getting started with ReEDS is available [here](https://

## Contact Us

If you have comments and/or questions, you can contact the ReEDS team at [ReEDS.Inquiries@nlr.gov](mailto:ReEDS.Inquiries@nlr.gov) or post a question on the [discussion pages](https://github.com/NatLabRockies/ReEDS-2.0/discussions).
If you have comments and/or questions, you can contact the ReEDS team at [ReEDS.Inquiries@nlr.gov](mailto:ReEDS.Inquiries@nlr.gov) or post a question on the [discussion pages](https://github.com/ReEDS-Model/ReEDS/discussions).
128 changes: 94 additions & 34 deletions docs/source/setup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Getting Started
The ReEDS model source code is available at no cost from the National Laboratory of the Rockies (NLR). The ReEDS model can be downloaded or cloned from [https://github.com/NatLabRockies/ReEDS-2.0](https://github.com/NatLabRockies/ReEDS-2.0).
The ReEDS model source code is available at no cost from the National Laboratory of the Rockies (NLR). The ReEDS model can be downloaded or cloned from [https://github.com/ReEDS-Model/ReEDS](https://github.com/ReEDS-Model/ReEDS).

New users may also wish to start with some ReEDS training videos which are available on the [NLR YouTube channel](https://youtu.be/aGj3Jnspk9M?si=iqCRNn5MbGZc8ZIO).

Expand Down Expand Up @@ -153,7 +153,7 @@ Screenshot of a test of GAMS from the terminal window
```

### Repository Setup
The ReEDS source code is hosted on GitHub: [https://github.com/NatLabRockies/ReEDS-2.0](https://github.com/NatLabRockies/ReEDS-2.0)
The ReEDS source code is hosted on GitHub at <https://github.com/ReEDS-Model/ReEDS>.

1. Install Git Large File Storage, instructions can be found here: [Installing Git Large File Storage](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage)

Expand All @@ -171,60 +171,120 @@ Screenshot of GitHub links to clone the ReEDS repository or download ZIP of the
```

### ReEDS2PRAS, Julia, and Stress Periods Setup
Julia will need to be installed and set up to successfully run the model since ReEDS uses stress periods by default. To get Julia and stress periods set up:
Julia will need to be installed and set up to successfully run the model since ReEDS uses stress periods by default. The recommended way to install Julia is via **juliaup**, the official Julia version manager, which makes it easy to install and switch between specific Julia versions. Julia `1.12.1` is the currently tested version across all platforms.

1. Install Julia
1. [max/linux]: Julia is included in the conda environment so no additional installation is needed
2. [windows]: install Julia from [https://julialang.org/downloads/](https://julialang.org/downloads/)
#### Step 1: Install juliaup

2. Navigate to the ReEDS-2.0 directory from the command line, then run `julia --project=. instantiate.jl`
````{tab-set}
```{tab-item} Windows
Install juliaup using `winget` from a terminal (Command Prompt or PowerShell):

#### Troubleshooting Issues with Julia Setup
When setting up julia on Windows, you may run into some issues when running `julia --project=. instantiate.jl`. The following steps can be followed to help resolve issues and get julia set up successfully:
1. Manually install [Random123](https://github.com/JuliaRandom/Random123.jl)
winget install --id Julialang.juliaup

Alternatively, install from the [Microsoft Store](https://www.microsoft.com/store/apps/9NJNWW8PVKMN).
```

```{tab-item} macOS / Linux
Run the following command from a terminal:

curl -fsSL https://install.julialang.org | sh

Follow the on-screen prompts. When installation is complete, open a new terminal session (or run `source ~/.bashrc` / `source ~/.zshrc`) so that `juliaup` is available on your PATH.

macOS and Linux users can also install via Homebrew:

brew install juliaup
```
````

Verify the installation was successful:
```
juliaup status
```

#### Step 2: Install and pin the tested Julia version

Install Julia `1.12.1` and set it as the default:
```
juliaup add 1.12.1
juliaup default 1.12.1
```

Confirm the active version:
```
julia --version
```

You should see `julia version 1.12.1`.

**NOTE**: If you need other versions of Julia for other purposes, you can run those other Julia versions using `julia +channel` (More info on the [juliaup README](https://github.com/JuliaLang/juliaup#using-juliaup)). Or you can easily switch between versions with juliaup. For example, to switch to version `1.11.2`, run `juliaup default 1.11.2`. To switch back to `1.12.1`, run `juliaup default 1.12.1`.

#### Step 3: Instantiate the Julia environment

Navigate to the ReEDS directory from the command line, then run:
```
julia --project=. instantiate.jl
```

#### Troubleshooting Issues with Julia Setup

**Windows**

When setting up Julia on Windows, you may run into some issues when running `julia --project=. instantiate.jl`. The following steps can be followed to help resolve issues and get Julia set up successfully:

1. If you've used another version of Julia (from the reeds2 conda environment or a previous installation), you may get errors about conflicting manifest. To get past this, you can delete the `Manifest.toml` file with `rm Manifest.toml` (on Unix systems) or `del Manifest.toml` (on Windows systems).

1. Manually install [Random123](https://github.com/JuliaRandom/Random123.jl)

2. Re-run `julia --project=. instantiate.jl`

If that doesn't resolve the issue, the following may help:
1. If you previously installed julia, uninstall it: `winget uninstall julia`
If that doesn't resolve the issue, try a clean install using juliaup:

2. Manually install [Julia 1.8.5](https://julialang.org/downloads/oldreleases/#:~:text=ea85e0489c36324c4da62163aa1b82fcf2f52f72d173ee7dd213a3a92992cab7-,Windows,-x86_64)
1. Remove any previously installed Julia version managed by juliaup: `juliaup remove 1.12.1`

3. Add the julia bin path to your environment PATH variable
1. If Julia was installed outside of juliaup, uninstall it first: `winget uninstall julia`

4. Install [MinGW](https://www.mingw-w64.org/downloads/)
1. Re-install Julia `1.12.1` via juliaup: `juliaup add 1.12.1 && juliaup default 1.12.1`

5. Open the julia interactive command line: `julia`
1. Open the Julia interactive command line: `julia`

6. Enter the julia package manager by pressing `]`, then run the following commands:
* `add Random123`
1. Enter the Julia package manager by pressing `]`, then run the following commands:
* `add Random123`
* `registry add https://github.com/JuliaRegistries/General.git`
* `registry add https://github.com/NatLabRockies/JuliaRegistries.git`
* `instantiate`

7. Leave the package manager by pressing backspace or Ctrl+C
1. Leave the package manager by pressing Backspace or Ctrl+C

8. Run the following commands to finish setup:
1. Run the following commands to finish setup:
* `import PRAS`
* `import TimeZones`
* `TimeZones.build()`

9. You can then leave the julia command line by typing `exit()`
1. You can then leave the Julia command line by typing `exit()`

**If you're experiencing issues on Mac, a possible solution is:**
1. Update the version of julia
**macOS / Linux**

2. Create the 'reeds2' conda environment with the environment.yml file
If you experience issues, try the following:

3. Run `julia` from the terminal to open the interactive command line

4. Run `import Pkg; Pkg.add("PRAS")`
1. Update to a known-good Julia version via juliaup:
```
juliaup add 1.12.1
juliaup default 1.12.1
```

5. Run `Pkg.add("TimeZones")`
2. Run `julia` from the terminal to open the interactive command line

6. Exit julia with the command `exit()`, then run `julia instantiate.jl`
3. Run:
```julia
import Pkg
Pkg.add("PRAS")
Pkg.add("TimeZones")
```

7. Manually move the Manifest.toml file from the julia environment (~/miniconda3/envs/reeds2/share/julia/environments/reeds2/Manifest.toml) to the ReEDS repo
4. Exit Julia with `exit()`, then re-run:
```
julia --project=. instantiate.jl
```

Comment thread
sriharisundar marked this conversation as resolved.
## Running ReEDS

Expand Down Expand Up @@ -273,12 +333,12 @@ NLR has a YouTube channel that contains tutorial videos for ReEDS. The following
If you'd like practice with running a specific ReEDS scenario, you can walk through the [ReEDS Training Homework](reeds_training_homework).

Additional resources and learning:
* [General information on ReEDS](https://www.nrel.gov/analysis/reeds/)
* [General information on ReEDS](https://www.nlr.gov/analysis/reeds/)
* [ReEDS POC list](https://nrel.sharepoint.com/:w:/s/ReEDS/ES6GQTyzXo1DnnCPlnAhg5QB8cPY--_01HkQkiOnrPskxw?e=flEAtY)
* [GitHub README](https://github.nrel.gov/ReEDS/ReEDS-2.0/blob/main/README.md)
* [GitHub README](https://github.com/ReEDS-Model/ReEDS/blob/main/README.md)
* [YouTube tutorials](https://www.youtube.com/playlist?list=PLmIn8Hncs7bG558qNlmz2QbKhsv7QCKiC)
* [GAMS language information](https://www.gams.com/latest/docs/UG_MAIN.html#UG_Language_Environment)
* [Tips and tricks for the bash shell](https://nrel-my.sharepoint.com/:p:/r/personal/ssundar_nrel_gov/Documents/Microsoft%20Teams%20Chat%20Files/02062024_what_the_shell.pptx?d=wa7aea3514f814d51924bf2dfa737d414&csf=1&web=1&e=qr1YuP)
* [Tips and tricks for the bash shell](https://nlr-my.sharepoint.com/:p:/r/personal/ssundar_nrel_gov/Documents/Microsoft%20Teams%20Chat%20Files/02062024_what_the_shell.pptx?d=wa7aea3514f814d51924bf2dfa737d414&csf=1&web=1&e=qr1YuP)

### NLR Specific Setup
See the [Internal ReEDS Documentation](https://nrel.sharepoint.com/:w:/s/ReEDS/Efathg8KjjtCkxW44vZpWQQBA2KsU3RadSsVauBMskEfUA?e=YaSIqc). Information on Yampa and HPC setup can be found there.
6 changes: 0 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ dependencies:
- scikit-learn=1.2
- scipy=1.11
- tqdm=4.65
## vvv Keep julia here if you're installing on the HPC.
## vvv If you're installing on a local machine, you can comment out
## vvv julia and install directly from https://julialang.org/downloads/.
## vvv If you're on Windows, you MUST comment out julia and install directly.
- julia=1.8
## ^^^
## vvv The next packages are optional for default settings and may
## vvv be excluded if you're having trouble building the environment.
- ipykernel=6.25 # for interactive python in VS Code
Expand Down
2 changes: 0 additions & 2 deletions instantiate.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
ENV["JULIA_SSL_CA_ROOTS_PATH"] = ""
ENV["JULIA_PKG_SERVER_REGISTRY_PREFERENCE"] = "eager"
import Pkg
Pkg.Registry.update()
Pkg.Registry.add("General")
Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/NatLabRockies/JuliaRegistry.git"))
Pkg.instantiate()

Pkg.add("Random123")
Expand Down
26 changes: 0 additions & 26 deletions reeds2pras/Project.toml

This file was deleted.

Loading
Loading