Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
bda96d5
copy .gov branch
patrickbrown4 Apr 15, 2026
41c4296
add inadvertently dropped climate heuristics inputs
patrickbrown4 Apr 15, 2026
2bb1cc7
delete files that have been renamed
patrickbrown4 Apr 17, 2026
873eb2f
rename ReEDS_Augur -> handoff, augur_data -> reeds_data, ReEDS_Augur_…
patrickbrown4 Apr 18, 2026
10db2bd
move b_sets.gms to reeds/core/setup
patrickbrown4 Apr 18, 2026
b90cef2
move reeds.prase back to reeds.inputs; move reeds.resource_adequacy.r…
patrickbrown4 Apr 18, 2026
1ce6daa
move auto-generated code to {casename}/autocode; fix report paths
patrickbrown4 Apr 19, 2026
ce95181
fix report_params.csv path; copy solver file
patrickbrown4 Apr 19, 2026
694b005
rename run.py -> runreeds.py; fix restart_runs.py (add --copy_reeds)
patrickbrown4 Apr 19, 2026
f8a0d12
Merge branch 'dev' into pb/reorg
patrickbrown4 Apr 19, 2026
03aa081
revert unintended changes; reeds/inputs -> reeds/input_processing in …
patrickbrown4 Apr 19, 2026
1fc51cb
fix a few more input_processing
patrickbrown4 Apr 19, 2026
c275928
Merge branch 'main' into pb/reorg
patrickbrown4 Apr 20, 2026
07038eb
add dev branch to CI
patrickbrown4 Apr 20, 2026
3e0c012
Merge branch 'dev' into pb/reorg
patrickbrown4 Apr 20, 2026
2e94718
fix hourly_writetimeseries.py import; turn off sources.csv/sources_do…
patrickbrown4 Apr 21, 2026
7879de3
Merge branch 'main' into pb/reorg
patrickbrown4 Apr 22, 2026
e814e0e
Merge branch 'main' into pb/reorg
patrickbrown4 Apr 23, 2026
f62577c
Fix straggler script names
patrickbrown4 Apr 23, 2026
c5dfd10
remove references to dev branch
patrickbrown4 Apr 23, 2026
f3594b0
Fix straggler script path
patrickbrown4 Apr 23, 2026
1758746
more stragglers; simplify code copy
patrickbrown4 Apr 23, 2026
7772a5c
clean up straggler filenames
patrickbrown4 Apr 23, 2026
9edcd70
Merge branch 'main' into pb/reorg
patrickbrown4 Apr 23, 2026
978a86d
fix more filepaths
patrickbrown4 Apr 24, 2026
3cc2a23
restart_runs.py: change copy_cplex -> copy_solver_settings
patrickbrown4 Apr 24, 2026
1712bd3
move get_optfile() from reeds.inputs to reeds.io
patrickbrown4 Apr 24, 2026
e70602e
move reeds.output_calc -> reeds.reports
patrickbrown4 Apr 24, 2026
1bd27a8
fix optfile path
patrickbrown4 Apr 24, 2026
278571f
fix runstatus.py and optfile path
patrickbrown4 Apr 24, 2026
187ff2b
reeds.io.read_output(): add backwards-compatibility to keep compare_c…
patrickbrown4 Apr 27, 2026
6068324
import gdxpds first to avoid warning
patrickbrown4 Apr 28, 2026
dfb6834
fix casemaker.py yearset
patrickbrown4 Apr 28, 2026
30a0e18
Merge branch 'main' into pb/reorg
patrickbrown4 May 1, 2026
2d282ec
remove references to non-existing rabatch.py/augurbatch.py
patrickbrown4 May 4, 2026
0856d36
update developer_best_practices.md for pathlib; remove reference to n…
patrickbrown4 May 4, 2026
52f31b8
Merge branch 'main' into pb/reorg
patrickbrown4 May 4, 2026
08688f8
Merge branch 'main' into pb/reorg
patrickbrown4 May 11, 2026
c93ccda
adapt labeler.yaml for new structure
patrickbrown4 May 11, 2026
b080e30
move run_r2x.py from scripts/ to postprocessing/
patrickbrown4 May 11, 2026
90ca0b3
move get_last_iter to reeds/core/terminus
patrickbrown4 May 11, 2026
364d165
PR template: More specific filepaths
patrickbrown4 May 12, 2026
0765044
remove no-longer-used files
patrickbrown4 May 12, 2026
8678c52
Merge branch 'main' into pb/reorg
patrickbrown4 May 12, 2026
151ff41
Merge branch 'main' into pb/reorg
patrickbrown4 May 12, 2026
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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Include additional illustrative plots describing input data, methods, testing, a
- [ ] No large data file(s) added/modified
- [ ] No substantive impact on runtime for full-US reference case
- [ ] No substantive impact on folder size for full-US reference case
- [ ] No change to process flow (runbatch.py, d_solve_iterate.py)
- [ ] No change to process flow (runreeds.py, reeds/core/solve/solve.py)
- [ ] No change to code organization
- [ ] No change to package requirements (environment.yml or Project.toml)

Expand Down
18 changes: 2 additions & 16 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- "Project.toml"
- "Manifest.toml"
- ".github/dependabot.yml"
- "instantiate.jl"

github_actions:
- changed-files:
Expand Down Expand Up @@ -42,15 +43,8 @@ tests:
model_changes:
- changed-files:
- any-glob-to-any-file:
- "*.gms"
- "**/*.gms"
- "runbatch.py"
- "d_solve*.py"
- "reeds/**"
- "ReEDS_Augur/**"
- "Augur.py"
- "instantiate.jl"
- "reeds2pras/**"
- "runreeds.py"

data_changes:
- changed-files:
Expand All @@ -60,19 +54,11 @@ data_changes:
- "postprocessing/**/inputs/**"
- "**/*.csv"
- "**/*.h5"
- "sources.csv"
- "sources_documentation.md"

hourlize:
- changed-files:
- any-glob-to-any-file: "hourlize/**"

input_processing:
- changed-files:
- any-glob-to-any-file:
- "input_processing/**"
- "preprocessing/**"

postprocessing:
- changed-files:
- any-glob-to-any-file: "postprocessing/**"
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ jobs:
- name: Set variables for internal github repo
run: |
echo "BASE_URL=https://github.com/ReEDS-Model/ReEDS" >> "$GITHUB_ENV"
cd "$GITHUB_WORKSPACE/docs/source/documentation_tools/"
sh generate_sources_md_file.sh
cd "$GITHUB_WORKSPACE"
python docs/source/documentation_tools/generate_markdown.py --githubURL "https://github.com/ReEDS-Model/ReEDS/blob/main" --reedsPath "$GITHUB_WORKSPACE"

- name: Build Sphinx documentation
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ jobs:
- name: Run ReEDS model
env:
SCENARIO: ${{ matrix.scenario }}
run: python runbatch.py -b "$batch" -c test -s "$SCENARIO"
run: python runreeds.py -b "$batch" -c test -s "$SCENARIO"

- name: Print GAMS log
if: runner.debug == '1'
Expand Down Expand Up @@ -290,7 +290,7 @@ jobs:
R2X_WEATHER_YEAR: "2012"
R2X_SYSTEM_JSON: ${{ format('{0}_system.json', matrix.scenario) }}
run: |
uvx --from "r2x-reeds>=0.3.5" python scripts/run_r2x.py \
uvx --from "r2x-reeds>=0.3.5" python postprocessing/run_r2x.py \
--reeds-run-path "$R2X_REEDS_RUN_PATH" \
--scenario "$R2X_SCENARIO" \
--solve-year "$R2X_SOLVE_YEAR" \
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ A step-by-step guide for getting started with ReEDS is available [here](https://
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://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`.
1. For interactive setup: `python runreeds.py`
2. For one-line operation: `python runreeds.py -b v20250314_main -c test`.
In this example, "v20250314_main" is the prefix for this batch of cases, and "test" is the suffix of the cases file, in this case `cases_test.csv`, located in the root of the repository.
Run `python runbatch.py -h` for information on other optional command-line arguments for ReEDS.
Run `python runreeds.py -h` for information on other optional command-line arguments for ReEDS.



Expand Down
8 changes: 4 additions & 4 deletions cases.csv
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ GSw_BinOM,Turn on/off binned FOM and VOM for each historical binned vintage,0; 1
GSw_Biopower,Turn on/off biopower,0; 1,1,
GSw_BioSupply,Multiplier to adjust total biomass supply,N/A,1,
GSw_BioTransportCost,Biomass collection and transport costs ($2004 per dry ton),N/A,22,
GSw_calc_powfrac,Switch to compute powfrac in e_report and e_powfrac_calc - dramatically reduces calculation times with hourly resolution,0; 1,0,
GSw_calc_powfrac,Compute powfrac in report.gms and powfrac_calc.gms - dramatically increases calculation times with hourly resolution,0; 1,0,
GSw_Canada,"Turn canada off [0], or use flexible (dispatchable-hydro-like) representation [1]",0; 1,1,
GSw_CarbTax,Turn on/off CO2 tax,0; 1,0,
GSw_CarbTaxOption,Choose the co2_tax input csv file (see inputs\emission_constraints),,default,
Expand Down Expand Up @@ -296,7 +296,7 @@ GSw_SitingGeo,Specify the Geothermal siting scenario,reference,reference,
GSw_SitingUPV,Specify the UPV siting scenario,open; reference; limited,reference,
GSw_SitingWindOfs,Specify the offshore wind siting scenario,open; reference; limited,reference,
GSw_SitingWindOns,Specify the onshore wind siting scenario,open; reference; limited,reference,
GSw_SkipAugurYear,Last year in which to skip running the Augur module,N/A,2020,
GSw_SkipRAyear,Last year in which to skip running the resource adequacy (RA) calculations,N/A,2020,
GSw_SpurCostMult,Multiplier for spur-line costs,float,1,
GSw_SpurScen,Spur-line scenario: 0 to include in resource supply curve; 1 to model endoegenously,0; 1,0,
GSw_SpurShare,Indicate whether wind-ons and upv are allowed to share spur line capacity,0; 1,0,
Expand Down Expand Up @@ -355,9 +355,9 @@ cleanup_level,How aggressively to clean up the case folder (see postprocessing/c
diagnose,Write A and B matrix of the model [0 = no diagnose ; 1 = diagnose ],0; 1,0,
diagnose_year,Year in which to start report diagnose,N/A,2022,
dump_alldata,switch to automatically dump data from final solve year into .gdx file,0; 1,0,
file_replacements,"List of files to replace from run folder, e.g: inputs_case/national_gen_frac.csv << //nrelnas01/ReEDS/some proj/national_gen_frac.csv || c_supplymodel.gms << //nrelnas01/ReEDS/some proj/c_supplymodel.gms",N/A,none,
file_replacements,"List of files to replace from run folder, e.g: inputs_case/national_gen_frac.csv << //nrelnas01/ReEDS/some_project/national_gen_frac.csv || c_model.gms << //nrelnas01/ReEDS/some_project/c_model.gms",N/A,none,
input_processing_only,Only run input_processing scripts; stop before creating and solving model,0; 1,0,
keep_augur_files,Indicate whether to keep (1) or delete (0) Augur csv and h5 files after Augur finishes. If you plan to run PRAS via ReEDS2PRAS then set this switch to 1.,0; 1,0,
keep_resource_adequacy_files,Indicate whether to keep (1) or delete (0) resource adequacy csv and h5 files after RA calculations finish,0; 1,0,
keep_g00_files,Keep (1) or delete (0) .g00 files for completed solve years,0; 1,0,
keep_run_terminal,"0=close run terminal, 1=keep run terminal open",0; 1,0,
land_use_analysis,switch to turn on/off land-use analysis. Requires the `reeds_to_rev` switch also be activated,0; 1,0,
Expand Down
2 changes: 1 addition & 1 deletion cases_small.csv
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ GSw_Refurb,0
GSw_PRM_CapCredit,0
GSw_Retire,0
GSw_RGGI,0
GSw_SkipAugurYear,2030
GSw_SkipRAyear,2030
GSw_StateCap,0
GSw_StateRPS,0
GSw_Storage,0
Expand Down
5 changes: 0 additions & 5 deletions createmodel.gms

This file was deleted.

13 changes: 7 additions & 6 deletions docs/source/developer_best_practices.md
Comment thread
patrickbrown4 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Since we have not yet adopted strict formatting guidelines, do not make code *fo
-------------| --------------- | ------------ |
Folders | lowercase | `inputs`, `docs` |
Files | typically lowercase with underscores (acronyms often left as uppercase); output files noun first | `battery_ATB_2024_moderate.csv`, `gen_ann` not `ann_gen` |
GAMS Files | letter-underscore prefix by category, alpha-ordered; numbering can help communicate ordering when multiple files share a category | `d1_financials.gms`, `d2_varfix.gms` |
GAMS Files | letter-underscore prefix by category, alpha-ordered; numbering can help communicate ordering when multiple files share a category | `2_financials.gms`, `5_varfix.gms` |
Parameters | lowercase with underscores, noun first; costs prefixed with "cost" | `curt_marg` not `marg_curt`, `cost_cap` |
Variables | all caps, noun first | `INV`, `INV_TRANS` |
Equations (model constraints) | prefixed with `eq_`, lowercase with underscores | `eq_reserve_margin` |
Expand Down Expand Up @@ -107,7 +107,7 @@ _Some exceptions to this might exist due to number scaling (e.g., emission rates
* GAMS functions such as sum, max, smax, etc. should use {}; Example: avg_outage(i) = sum{h,hours(h)*outage(i,h)} / 8760 ;
* When including the semicolon on the end of a line there should be a space between the semicolon and the last character of the line (see previous example)
* When using `/ /` for a parameter declaration, place the closing semicolon on the same line as the final slash: `/ ;`
* Sums outside of equations (e.g., in e_reports) need not be split over multiple lines if they do not exceed the line limit
* Sums outside of equations (e.g., in `report.gms`) need not be split over multiple lines if they do not exceed the line limit
* Do not use hard-coded numbers in equations or calculations. Values should be assigned to an appropriate parameter name that is subsequently used in the code.
* Large input data tables should be loaded from individual data files for each table, preferably in *.csv format. Large data tables should not be manually written into the code but can be written dynamically by scripts or inserted with a $include statement.
* Compile-time conditionals should always use a tag (period + tag name) to clearly define the relationships between compile-time conditional statements. Failure to do so hurts readability sometimes leads to compilation errors. Example:
Expand Down Expand Up @@ -162,21 +162,22 @@ _Some exceptions to this might exist due to number scaling (e.g., emission rates

* If preprocessing is needed to create an input file that is placed in the ReEDS repository, the preprocessing scripts or workbooks should be included in the [ReEDS_Input_Processing repository](https://github.com/ReEDS-Model/ReEDS_Input_Processing). Data from external sources should be downloaded programmatically when possible.

* Any scripts that preprocess data after a ReEDS run is started should be placed in the input_processing folder.
* Any scripts that preprocess data after a ReEDS run is started should be placed in the `reeds/input_processing` folder.
* Input processing scripts should start with a block of descriptive comments describing the purpose and methodology, and internal functions should use docstrings and liberal comments on functionality and assumptions.

* Any costs read into b_inputs should already be in 2004$. Cost adjustments in preprocessing scripts should rely on the deflator.csv file rather than have hard-coded conversions.

* In general, if inputs require calculations before they are ingested into b_inputs, those calculations should be done in Python rather than in GAMS. GAMS can be used for calculations where the GAMS syntax simplifies the calculation or where upstream dependencies make it challenging for the calculations to happen in Python preprocessing scripts.

* In Python, file paths should be added using os.path.join() rather than writing out the filepath with slashes.
* In Python, file paths should be specified using `from pathlib import Path` and `Path(reeds.io.reeds_path, 'foldername', 'maybe_more_foldernames', 'filename.extension')` instead of writing out the filepath as a string with slashes.
Use absolute filepaths whenever possible.

* Data column headers should use the ReEDS set names when practical.
* Example: data that include regions should use "r" for the column name rather than "ba", "reeds_ba", or "region".

* Preprocessing scripts in input_processing should not change the working directory or use relative filepaths; absolute filepaths should be used wherever possible.

* When feasible, inputs used in the objective function (c_supplyobjective.gms) should be included in tests/objective_function_params.yaml. Inputs included in this .yaml file will be checked for missing values using input_processing/check_inputs.py.
* When feasible, inputs used in the objective function (`d_objective.gms`) should be included in tests/objective_function_params.yaml. Inputs included in this .yaml file will be checked for missing values using input_processing/check_inputs.py.

#### Input Data

Expand Down Expand Up @@ -629,7 +630,7 @@ Additionally, if you want to re-run a given scenario without having to run all o
* To avoid the prompts when kicking off a run, you can use the command line arguments:
* The following example runs the scenarios in cases_test.csv with the batch name '20240717_test'. The '-r -1' means that all cases will run simultaneously.
```
python runbatch.py -c test -b 20240717_test -r -1
python runreeds.py -c test -b 20240717_test -r -1
```
* All options for command line arguments that can be used:
| Flag | |
Expand Down
4 changes: 3 additions & 1 deletion docs/source/model_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3751,7 +3751,9 @@ For all ReEDS system cost results, we assume the operational costs for the nonmo
The marginal electricity prices in ReEDS are taken as the shadow prices from the constraints in the model that are directly impacted by the need to serve electricity. These include the load balance constraint, the operating reserve requirement, the RPS and CES requirements, and the planning reserve margin requirement (applied either in stress periods or seasonally via capacity credits). Taken together, these values show the total marginal cost of serving electricity in a given region and time slice. Weighted average versions are also calculated to report national annual marginal electricity prices. These marginal prices are most analogous to wholesale electricity prices but within a model that has full coordination and foresight.

```{admonition} Marginal Price Outputs
Marginal electricity price outputs are calculated with `reqt_price` in `e_report.gms` and are outputs in `reqt_price.csv`. The quantity required by the model is reported in the `reqt_quant.csv` output. These two taken together can be used to calculate a $/MWh electricity price, which is done in make of the ReEDS outputs and reported as "Bulk System Electricity Price" in bokehpivot HTML outputs and in other output locations.
Marginal electricity price outputs are recorded in `reqt_price.csv`.
The quantity required by the model is reported in `reqt_quant.csv`.
These two can be combined to calculate a \$/MWh electricity price.
```


Expand Down
4 changes: 2 additions & 2 deletions docs/source/postprocessing_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ The PRAS model is typically run multiple times during each ReEDS case (as long a
This script reruns PRAS on a finished ReEDS case (provided by the single required command-line argument) and allows the settings to be changed.
For example, to use a different number of samples than are specified by the default `pras_samples` switch, use the `-s/--samples` command-line argument.

### Run a dispatch model: `run_pcm.py`
### Run a dispatch model: `postprocessing/run_pcm.py`

This script reruns a completed ReEDS case as a dispatch simulation at higher time resolution.
The operational constraints in `c_supplymodel.gms` are used directly, but the investment and capacity variables are fixed to their previously optimized values; only the operational variables are re-optimized.
The operational constraints in `c_model.gms` are used directly, but the investment and capacity variables are fixed to their previously optimized values; only the operational variables are re-optimized.
365 representative 1-day periods at 1-hour resolution are used by default, but these settings can be changed using the `-s/--switch_mods` switch.

This approach is distinct from the [R2X](https://github.com/NatLabRockies/R2X) tool, which formats the results of a ReEDS case as inputs to a separate production cost modeling tool such as [Sienna](https://github.com/NREL-Sienna) or [PLEXOS](https://www.energyexemplar.com/plexos).
Expand Down
4 changes: 2 additions & 2 deletions docs/source/reeds_training_homework.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ orphan: true
- Open a new terminal and activate the reeds2 environment

7. Start a new run
- `python runbatch.py`
- `python runreeds.py`
- when prompted for case file name, enter `examples`
- when prompted for how many simultaneous runs you would like to execute, enter 2
- The 'ERCOT_county' and 'ERCOT_BA' runs should start
Expand Down Expand Up @@ -74,7 +74,7 @@ Create an informal slide deck with the following results:
- Open a new terminal and activate the reeds2 environment

7. Start a new run
- `python runbatch.py`
- `python runreeds.py`
- when prompted for case file name, enter `examples`
- The 'Western_BA_Decarb' run should start

Expand Down
2 changes: 1 addition & 1 deletion docs/source/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ If you experience issues, try the following:
**Quick Start:**
1. Navigate to the ReEDS directory from the command line
2. Activate environment: `conda activate reeds2`
3. Run the model: `python runbatch.py`
3. Run the model: `python runreeds.py`
4. Follow the prompts for batch configuration
5. Check for a successful run:
1. Look for CSV files in `runs/[batchname_scenario]/outputs` (a successful run should have 100+ csv files in the outputs folder)
Expand Down
Loading
Loading