Skip to content

Add NG Multipliers as inputs#65

Draft
SoLaraS2 wants to merge 33 commits intomainfrom
ko/temp_based_natgas_prices
Draft

Add NG Multipliers as inputs#65
SoLaraS2 wants to merge 33 commits intomainfrom
ko/temp_based_natgas_prices

Conversation

@SoLaraS2
Copy link
Copy Markdown
Collaborator

@SoLaraS2 SoLaraS2 commented Apr 28, 2026

Summary

Technical details

  • Added "get_degree_days" function to io.py
  • Added "Natural Gas Price Diffs" block in fuelcostprep.py to create "natgas_price_diffs.h5"
  • Added "get_natgas_price_diffs" function to hourly_writetimeseries.py to get a GAMS compatible csv with
    representative hourly NG price multipliers
  • fuelcostprep.py now imports NumPy

Implementation notes

  • "get_degree_days" has two options for how to calculate the degree days, default is:
    ----(Daily max + Daily min)/2 - 18.33C
  • With houly_formula=True:
    ----daily sum (Hourly temp - 18.33C)

Relevant sources or documentation

Validation, testing, and comparison report(s)

  • Imported the functions into a Jupyter Notebook and outputted check along the way. Also compared final outputs' formats to those of files known to have desired shape.

Checklist for author

Details to double-check

  • Charge code provided to reviewers
  • 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:
  • Code formatting standardized
  • Reusable functions used where possible instead of copy/pasted code (I tried my best to find preexisting relevant functions, but some may have slipped through)

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 (runbatch.py, d_solve_iterate.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

  • LLMs used for timestamp compatibility between different outputs to ensure consistency in the final csv outputted
  • LLMs used to run through the files and find relevant predefined functions I may have originally missed
  • LLMs used to debug h5 file handling

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

Comment thread reeds/io.py Outdated
Comment thread inputs/zones/state_groups.csv Outdated
WI,USA,East_North_Central,lake-states,Midwest
WV,USA,South_Atlantic,appalachia,MidAtlantic
WY,USA,Mountain,mountain,Mountain
st,country,cendiv,usda_region,h2ptcreg,ngreg
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.

  1. How about gasreg instead of ngreg, since the techs are gas-cc/gas-ct and we don't use ng much throughout the code?
  2. We'll need to add the new region level to https://reeds-model.github.io/ReEDS/model_documentation.html#figure-hierarchy (and describe the new method in the docs). If the regions are finalized, let me know and I can remake the figure.

Copy link
Copy Markdown
Contributor

@kodiobika kodiobika Apr 29, 2026

Choose a reason for hiding this comment

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

gasreg SGTM and thanks for the heads up on the docs. The regions are finalized so if you could remake the figure that'd be great, thanks! Here's the charge code if needed: OOSP >-> 10291 - 05.18.01

Comment thread reeds/io.py Outdated
return load_in, load_out


def get_natgas_price_diffs(sw, hmap_myr, hmap_allyrs, inputs_case, periodtype='rep'):
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.

Since this file is modified, can you run all the temporal tests from cases_test.csv and make sure they still work?

  • Pacific_CC
  • Pacific_weks
  • Pacific_full_year
  • Interday_storage
  • Pacific_rep7

@kodiobika kodiobika self-requested a review April 29, 2026 15:14
@kodiobika kodiobika marked this pull request as draft April 29, 2026 15:14
Copy link
Copy Markdown
Contributor

@kodiobika kodiobika left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this! It's looking great so far -- mostly just some stylistic suggestions

Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Comment thread input_processing/fuelcostprep.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants