Skip to content

[FEATURE] Add region-level class binning procedure to resource.py - #253

Closed
jvcarag wants to merge 1 commit into
mainfrom
vc/RegionalClassBinning
Closed

jvcarag wants to merge 1 commit into
mainfrom
vc/RegionalClassBinning

Conversation

@jvcarag

@jvcarag jvcarag commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This small PR adds functionality for region-specific class binning of resource supply curves to hourlize/resource.py.

Implementation notes

Logic is added to the add_classes() function in resource.py that bins classes either nationally or sub-nationally based on whether or not a region column exists in the input data. Class data without a region column have one appended to it containing a single CONUS entry.

The class data is then binned for each entry in the region column (data mapped with the single CONUS entry are effectively binned at national resolution)

Issues resolved

This PR addresses the following comment in resource.py and was initially part of changes made for PR #184:

ReEDS/hourlize/resource.py

Lines 457 to 459 in 766d4b3

# Add dynamic, region-specific class bins based on class_bin_method
if class_bin:
#In this case, class names in class_path must be numbered, starting at 1

Validation, testing, and comparison report(s)

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 new parameters are added to d_objective.gms, they are included in objective_function_params.yaml for completeness checking
    • 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

@jvcarag
jvcarag requested a review from mmowers October 9, 2026 16:30
@jvcarag jvcarag added the enhancement New feature or request label Oct 9, 2026
Comment thread hourlize/resource.py

@patrickbrown4 patrickbrown4 Oct 9, 2026 •

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.

I'm not sure about this one; we save one set of supply curves that are meant to work for all supported region resolutions, but this approach would bake the regions into the supply curves.

And we want to make the classes user-adjustable at runtime anyway (#59), so I think the direction we're going is to stop writing the classes from hourlize and instead determine them dynamically during the run.

@jvcarag

jvcarag commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

Per discussion with @mmowers as well as comment from @patrickbrown4 above, closing this PR since tech class assignment in hourlize is set for deprecation by PR #59

@jvcarag jvcarag closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request hourlize

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants