Skip to content
This repository was archived by the owner on Apr 22, 2026. It is now read-only.
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build-docs-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 1
lfs: true
lfs: false

- name: Set up Python 3.11
uses: actions/setup-python@v4
Expand Down
8 changes: 4 additions & 4 deletions Augur.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def run_pras(
start_year = min(sw['resource_adequacy_years_list'])
## ReEDS2PRAS runs at hourly resolution
timesteps = sw['num_resource_adequacy_years'] * 8760
command = [
command = ' '.join([
"julia",
f"--project={sw['reeds_path']}",
### As of 20231113 there seems to be a problem with multithreading in julia on
Expand Down Expand Up @@ -78,11 +78,11 @@ def run_pras(
f"--pras_agg_ogs_lfillgas={int(sw['pras_agg_ogs_lfillgas'])}",
f"--pras_existing_unit_size={int(sw['pras_existing_unit_size'])}",
f"--pras_seed={int(sw['pras_seed'])}",
]
print(' '.join(command))
])
print(command)
print(f'vvvvvvvvvvvvvvv run_pras.jl {t}i{iteration} vvvvvvvvvvvvvvv')
log = open(os.path.join(casedir, 'gamslog.txt'), 'a')
result = subprocess.run(command, stdout=log, stderr=log, text=True)
result = subprocess.run(command, stdout=log, stderr=log, text=True, shell=True)
log.close()
print(f'^^^^^^^^^^^^^^^ run_pras.jl {t}i{iteration} ^^^^^^^^^^^^^^^')

Expand Down
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<img src="https://github.nrel.gov/ReEDS/ReEDS-2.0/blob/main/docs/source/_static/reeds-logo-submark.png" alt="SWC" align="left" width="192px" height="192px"/>
<img align="left" width="0" height="192px" hspace="10"/>

### ReEDS 2.0
> **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://nrel.github.io/ReEDS-2.0)
> ![Static Badge](https://img.shields.io/badge/python-3.11-blue)
> ![GitHub License](https://img.shields.io/github/license/NREL/ReEDS-2.0)

<br/>
<br/>
<br/>
## ReEDS 2.0
**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://nrel.github.io/ReEDS-2.0)
![Static Badge](https://img.shields.io/badge/python-3.11-blue)
![GitHub License](https://img.shields.io/github/license/NREL/ReEDS-2.0)

</br>
</br>

This GitHub repository contains the source code for NREL's ReEDS model.
The ReEDS model source code is available at no cost from the National Renewable Energy Laboratory.
Expand Down
1 change: 0 additions & 1 deletion ReEDS_Augur/augur_switches.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ decimals,3,int,number of decimals to round results to for ReEDS
flex_consume_techs,"dac,electrolyzer",list,list of consume techs that are flexible
keepfiles,"dropped_load,cf",list,list of temporary files to keep
marg_vre_steps,2,int,Number of previous solve years to consider when evaluating the marginal VRE step size (default: 2). Must be at least 1; a value of 2 can help reduce oscillations. Augur will automatically drop from consideration solves that are more than 5 years from the previous solve.
plot_years,"2020,2022,2023,2026,2029,2030,2035,2036,2040,2041,2045,2050",list,indicate years for which to make plots of intermediate Augur results
storcap_cutoff,1,float,[MW and MWh] Minimum storage capacity to send to ReEDS2PRAS (applies to both power and energy capacity)
15 changes: 7 additions & 8 deletions ReEDS_Augur/diagnostic_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1310,14 +1310,13 @@ def main(sw, augur_plots=1):
else:
sw['iteration'] = iteration

### Make the plots if it's a plot year
if t in sw['plot_years']:
print('plotting intermediate Augur results...')
try:
main(sw)
except Exception as _err:
print('diagnostic_plots.py failed with the following exception:')
print(traceback.format_exc())
### Make the plots
print('plotting intermediate Augur results...')
try:
main(sw)
except Exception as _err:
print('diagnostic_plots.py failed with the following exception:')
print(traceback.format_exc())

### Remove intermediate csv files to save drive space
if (not int(sw['keep_augur_files'])) and (not int(sw['debug'])):
Expand Down
41 changes: 33 additions & 8 deletions ReEDS_Augur/prep_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ def intify(v):
vre_cf_marg.index = h_dt_szn.set_index(['ccseason','year','h','hour']).index
h5out['vre_cf_marg'] = vre_cf_marg


h_dt_szn_load_years = h_dt_szn.loc[h_dt_szn.index.isin(load.index.get_level_values('datetime'))]
#%%### H2 and DAC load
### First just make it all inflexible (necessary for PRAS)

#%%### Flexible load
### H2 and DAC: Make it all inflexible (necessary for PRAS)
load_h2dac_all_hourly = (
gdxreeds['prod_filt']
.groupby(['r', 'allh']).Value.sum().reset_index()
Expand All @@ -315,8 +315,8 @@ def intify(v):
.reindex(h_dt_szn_load_years.index)
)

#%%## DR Shed load
### Get the DR shed load for all weather years
#%% Load shedding
## Get the DR shed load for all weather years
gen_h_stress = gdxreeds['gen_h_stress_filt']
gen_shed = gen_h_stress.loc[
(gen_h_stress['t'] == t)
Expand All @@ -328,6 +328,15 @@ def intify(v):
## Now fill other hours with zero
gen_shed_combined = gen_shed_combined.reindex(h_dt_szn.index).fillna(0)

#%% Flexibly sited load -> pd.Series with index = regions and missing values 0-filled
ra_cap_loadsite = (
gdxreeds['ra_cap_loadsite']
.loc[gdxreeds['ra_cap_loadsite']['t'] == t]
.drop(columns='t')
.set_index('r')
.squeeze(1)
.reindex(load.columns).fillna(0)
)

#%%### Total load and net load
### Get Candian exports and add to this solve year's load
Expand All @@ -341,14 +350,28 @@ def intify(v):
### PRAS doesn't yet handle flexible load, so include all H2/DAC load in the
### version we write for PRAS
if int(sw['pras_include_h2dac']):
print(f'Added H2/DAC to PRAS load since pras_include_h2dac = {sw.pras_include_h2dac}')
pras_load = load_year.add(load_h2dac_all_hourly, fill_value=0)
else:
pras_load = load_year.copy()

### Subtract dr-shed load
if int(sw.GSw_DRShed) and not gen_shed_combined.empty:
print(f'Subtracted shed load from PRAS load since GSw_DRShed = {sw.GSw_DRShed}')
pras_load = pras_load.subtract(gen_shed_combined, fill_value=0).clip(lower=0)

### Add flexibly sited load if its profile is inflexible (GSw_LoadSiteCF = 1)
if (
np.isclose(float(sw.GSw_LoadSiteCF), 1)
and len(ra_cap_loadsite)
and int(sw.GSw_LoadSiteRA)
):
print(
f'Added CAP_LOADSITE to PRAS load since GSw_LoadSiteCF = {sw.GSw_LoadSiteCF} '
f'and GSw_LoadSiteRA = {sw.GSw_LoadSiteRA}'
)
pras_load += ra_cap_loadsite

h5out['pras_load'] = pras_load
## Include the hourly H2/DAC load for debugging
h5out['pras_h2dac_load'] = load_h2dac_all_hourly
Expand Down Expand Up @@ -385,8 +408,10 @@ def intify(v):
max_cap = cap_nonloadtechs.set_index(['i','v','r']).Value.rename('MW')
## Drop VRE since it is handled through pras_vre_gen
max_cap = max_cap.loc[
~max_cap.index.get_level_values('i').isin(
list(techs_vre_simplify.keys()) + list(techs_vre_simplify.values())
~max_cap.index.get_level_values('i').str.startswith(
tuple(
list(techs_vre_simplify.keys()) + list(techs_vre_simplify.values())
)
)
].copy()
## Aggregate geothermal
Expand Down Expand Up @@ -473,7 +498,7 @@ def intify(v):
)
watertech2tech = watertech2tech.map(lambda x: upgrade2from.get(x,x))

techmap = pd.concat([upgrade2from, watertech2tech])
techmap = pd.concat([upgrade2from, watertech2tech]).to_dict()

### Simplify all the techs in output csv files and sum the capacities
for key in csvout:
Expand Down
Loading