Skip to content

End ReEDS run early if no valid scenarios#93

Merged
kennedy-mindermann merged 7 commits into
mainfrom
km/error-handling
May 19, 2026
Merged

End ReEDS run early if no valid scenarios#93
kennedy-mindermann merged 7 commits into
mainfrom
km/error-handling

Conversation

@kennedy-mindermann
Copy link
Copy Markdown
Contributor

@kennedy-mindermann kennedy-mindermann commented May 14, 2026

Summary

This PR updates runreeds.py to end the run in a few different places if there are no valid scenarios left.

I also did a minor update to one of the existing error messages so it was easier to read.

Validation, testing, and comparison report(s)

I didn't do a full run since it doesn't change the model itself. I did check all combinations of getting a run started to make sure it behaved as expected.

Checklist for author

Details to double-check

  • Charge code provided to reviewers
  • Included comparison reports for appropriate test cases
  • Documentation updated if necessary
  • If input data added/modified:
    • Dollar year recorded and converted to 2004$ for GAMS
    • Timeseries are in Central Time
    • Units are specified
    • Preprocessing steps have been documented and committed to ReEDS_Input_Processing
    • New large data files handled with .h5 instead of .csv
    • If spatially resolved inputs are modified, the following visualizations for each file are included in the PR description (time-averaged if the inputs are time-resolved):
      • Map of absolute values before
      • Map of absolute values after
      • Map of differences: (after - before) or (after / before)
    • If entries are added/removed/changed in the EIA-NEMS unit database:
      • Changes have been committed to ReEDS_Input_Processing
      • hourlize/resource.py was rerun to regenerate the existing/prescribed VRE capacity data
  • Code formatting standardized
  • Reusable functions used where possible instead of copy/pasted code

General information to guide review

  • Zero impact on results of default case
  • 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 (runreeds.py, reeds/core/solve/solve.py)
  • No change to code organization
  • No change to package requirements (environment.yml or Project.toml)

Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how

Tag points of contact here if you would like additional review of the relevant parts of the model

Copy link
Copy Markdown
Contributor

@patrickbrown4 patrickbrown4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kennedy, some suggestions but otherwise looks good

Comment thread runreeds.py Outdated
Comment on lines +889 to +890
f'Specified single={single} but available cases are: '
+ ', '.join([c for c in df_cases.columns])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would revert and keep these on their own lines as I think that's easier to read

Comment thread runreeds.py Outdated
single=single,
skip_checks=skip_checks,
)
all_case_names = list(df_cases.columns)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability, define further down, next to the one place it's used

Comment thread runreeds.py Outdated
Comment thread runreeds.py Outdated
Comment thread runreeds.py Outdated
kennedy-mindermann and others added 6 commits May 18, 2026 14:37
Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com>
Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com>
Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com>
@kennedy-mindermann kennedy-mindermann merged commit fe1bd7f into main May 19, 2026
10 checks passed
@kennedy-mindermann kennedy-mindermann deleted the km/error-handling branch May 19, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants