Reorganize root of repo#36
Conversation
…{year}.gdx -> ccdata_{year}.gdx, Augur (in general) -> resource adequacy
…a functions back to reeds.resource_adequacy.stress_periods
…cumentation.md build until we decide what to do about it
wesleyjcole
left a comment
There was a problem hiding this comment.
I'm a fan of this new structure (it will take my brain a while to adjust to the new names and organization). Thanks for the thought you've put in on this.
I'll kick off a Windows test.
| Project.toml,Project.toml,1,ignore,ignore,,,,,,,,,,, | ||
| b_inputs.gms,b_inputs.gms,1,ignore,ignore,,,,,,,,,,, |
There was a problem hiding this comment.
These files are removed, but the new files are not added. I didn't see how the new files get copies over to the runs folder. Can you help me understand that?
There was a problem hiding this comment.
Yep that now happens upfront in runreeds.py, next to where we create the other folders in the case folder:
Lines 1238 to 1243 in 1758746
| solve_year = 2035 #need ReEDS Augur data for the input solve year | ||
| weather_year = 2012 # must be 2007-2013 or 2016-2023 |
There was a problem hiding this comment.
Why drop these comments?
There was a problem hiding this comment.
For the first one, just because it didn't say much (and I was looking for all mentions of augur); for the second, because I'd like to have allowed values specified and checked as far upstream as possible instead of repeated throughout the code (to make it less painful when we hopefully someday start doing yearly updates to weather data).
But the bigger reason is that I think we should point people who want to run PRAS outside of the ReEDS/PRAS loop to postprocessing/run_reeds2pras.py (which handles the data handoff from ReEDS and a lot of data integrity checking before starting ReEDS2PRAS) instead of directly to the ReEDS2PRAS Julia package. That would be a bigger rewrite to this file though.
bsergi
left a comment
There was a problem hiding this comment.
The new structure is great. A couple of questions and a few small bugs, but otherwise looking good.
I did a test run locally (mac) and the gamslog.txt didn't include any of the input_processing script outputs so I think something is off there.
| @@ -19,6 +21,8 @@ | |||
| help='Proceed without double-checking') | |||
| parser.add_argument('--more_copyfiles', '-m', type=str, default='', | |||
There was a problem hiding this comment.
does the -m argument still work for individual files as long as the user specifies the full path (e.g., "reeds/core/terminus/report.gms")?
There was a problem hiding this comment.
Also I think we'd need to add the path in the copy_cplex below for this to work
There was a problem hiding this comment.
Good catch. For the copy_cplex functionality, it's a little different now since we only keep the single cplex file used by the run in the {casepath} root.
Instead of making copy_cplex take a number (which wouldn't work anyway if the user was using cbc, gurobi, or something else), we change it to a binary --copy_solve_settings flag, which, if True, copies the solver file specified by the solver/GSw_gopt switches for that case (parsed by reeds.inputs.get_optfile()) from the repo to the root of the casepath?
There was a problem hiding this comment.
I like that. The only nuance would be that the user would have to modify the solve file in place for each batch of different settings, but I don't think that's too demanding and the simplicity of your proposed switch is nice.
Co-authored-by: Wesley Cole <49044852+wesleyjcole@users.noreply.github.com>
|
The Pacific test case ran fine for me on Windows. I also noticed that there are still several instances of the old names throughout the code (e.g., "d_solveoneyear.gms" and "augur"). If you want any help cleaning those up, let me know. |
Co-authored-by: Brian Sergi <bsergi@nlr.gov>
My `gamslog.txt1 file had the input_processing script outputs in it. |
Yeah that was a separate issue, fixed by #26; it should work normally if you check it out now. |
…ases.py working across the transition
bsergi
left a comment
There was a problem hiding this comment.
Thanks for the updates--a few small additional notes but overall looks good to me.
| """ | ||
| sw = get_switches_base(case, **kwargs) | ||
| GSw_gopt = int(sw.GSw_gopt) | ||
| if GSw_gopt == 1: |
There was a problem hiding this comment.
I'm confused about this if block. Isn't the entry for GSw_gopt an integer? When would the length be more than 1? If there is more capability here than I am remembering it would be good to update the description for GSw_gopt in cases.csv.
There was a problem hiding this comment.
Yeah it's a weird format but that's how it's described at https://gams.com/49/docs/UG_GamsCall.html#GAMSAOoptfile:

Even though I've never personally needed more than 10, I figured it'd be safest just to match the GAMS format
There was a problem hiding this comment.
Ah ok, I see that the str conversion is just trying to get the number of digits here.
Summary
Addresses issues 1713 / 2017 (on the old repo) by reorganizing the root of the repo.
Feedback welcome!
Technical details
Proposed structure
The general idea is to move scripts/functions that are used during the run to subfolders of
reeds/:reeds/coreinput_processingscripts move toreeds/input_processingreeds/hpcreeds/solverReEDS_Augurgoes toreeds/resource_adequacyreeds2prasgoes toreeds/resource_adequacy/reeds2pras{casename}/handoffb_sets.gms,report_params.gms) goes to{casename}/autocodehelpersHere's the high-level view of the proposed structure (generated by running
tree . -I '__pycache__|preprocessing|postprocessing|runs|inputs|hourlize|docs|tests|*.jl' --dirsfirst; leaves out .jl scripts since theReEDS2PRASstructure is unchanged (therun_pras.jlandinstantiate.jlscripts still exist but are not shown)).Switches added/removed/changed
GSw_SkipAugurYear->GSw_SkipRAyearkeep_augur_files->keep_resource_adequacy_filesAdditional changes
hourlize/reeds_to_revfiles (.pylintrcand.pre-commit-config.yaml) that were dropped in the repo moveIssues resolved
1713 / 2017 (on the old repo)
Validation, testing, and comparison report(s)
Zero change for the USA_defaults case: results-v20260426_mainK0_USA_defaults,v20260425_reorgK0_USA_defaults.pptx
To check
preprocessing(at least the ones that were working on main:casemaker.pyandget_case_periods.pypostprocessing:compare_cases.py,single_case_plots.pyhelpersinput_processing->reeds/inputschanges (should now bereeds/input_processingShorten the name of(save for later)reeds.report_utils(it's mostlyreeds.ppt; consider movingparse_caselist()to a newreeds.parsealong withparse_regions()etc.)Checklist for author
Details to double-check
General information to guide review
Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how
No