Repository navigation
Prompt user if too few representative periods, islanded zones, or failed RA - #243
Conversation
| @@ -64,7 +64,7 @@ Here is partial list of remotely hosted files used by ReEDS: | |||
| - So turning up `GSw_HourlyNumClusters` on its own won't increase the temporal coverage. If you want more temporal coverage, the options are: | |||
There was a problem hiding this comment.
above it says "needs ~33 days"--with 11 regions and 3 features is it correct to say that the max days is 33 days but that it could come up with fewer (presumably if there is some overlap in days across regions/features)?
There was a problem hiding this comment.
This is just meant as an empirical rule of thumb based on what I've observed across many runs. It's not always the absolute max; for example, if looking at 1 region and 1 feature, you need 2 days to minimize the error (one on either side of the average, weighted to reproduce the average). I haven't tried to derive the absolute max, but the previous sentence says "there will be a maximum number of days it needs to reproduce the distribution".
| ) | ||
| print(msg) | ||
| err = f'Insufficient representative periods: {numperiods}' | ||
| if force: |
There was a problem hiding this comment.
What do you think about including a conditional here that also allows proceeding with a warning if numperiods >= GSw_HourlyNumClusters? That would still prevent people from inadvertently running with too few representative days but also allow people to run specific use cases with fewer than 24 days without neededing to force.
There was a problem hiding this comment.
I guess I'm on the fence. I generally worry that warnings are too easy to miss, and I'm not sure if all users know that 4 periods (for example) is absolutely not enough for analysis. I guess I feel like the extra keystoke when intentionally testing low numbers of periods is worth it to catch problematic settings earlier in the process for analysis users. But it's probably worth more discussion.
| itls = reeds.inputs.get_itls(GSw_ZoneSet=sw['GSw_ZoneSet']) | ||
| dfitl = itls.loc[(itls.r.isin(zones)) & (itls.rr.isin(zones))].copy() | ||
| not_islands = dfitl[['r','rr']].stack().unique().tolist() | ||
| islands = [r for r in zones if r not in not_islands + ISLAND_EXCEPTIONS] |
There was a problem hiding this comment.
Is the exceptions list just to deal with the WECC and EI parts of TX?
There was a problem hiding this comment.
No, it's because TX showed up as an island when using the z48 zone set. But that's just because I forgot to include B2B connections in the determination of islands. I've added those so we can get rid of ISLAND_EXCEPTIONS.
| Inputs for testing: | ||
| sw = { | ||
| 'GSw_ZoneSet': 'z90', | ||
| 'GSw_Region': 'transreg/PJM', |
There was a problem hiding this comment.
Long-term I could see developing some ITL estimates for an islanded PJM, but I suppose that is only needed for people that might be running it. My recent tests with an islanded PJM have involved taking the entire state with any PJM region which has helped avoid this issue.
There was a problem hiding this comment.
We'd need to modify the ITL definition to support it since no lines directly connect the separate regions; the alternative would be to add them to hvdc_planned-baseline.csv (which, even though it has hvdc in the name, should allow AC additions too). But yeah I agree, I would generally recommend modeling full interconnections for analysis since there's so much trade between regions.
Summary
This PR addresses #35 (and a few other conditions that may surprise the user) by raising a prompt or error in the following conditions:
GSw_HourlyClusterAlgorithm = optimizedand a small number of the levels specified byGSw_HourlyClusterRegionLevelGSw_Region = transreg/PJM, which unrealistically islands the PJM parts of IL and MIstress_periods.pyand is bypassed ifdebug > 0Note that the Pacific test case will fail the first check! To avoid the prompt for small test cases, add the
-for--forceflag when starting your run. Single-character flags can be combined with other flags. Any of the following would work:Or you could add the following alias to your
~/.bashrc(on kestrel) or~/.bash_profile(local) file:alias testreeds='python runreeds.py -f'and then
testreeds -b v20261002_mainM0 -c test -s PacificBut you should be careful not to get in the habit of bypassing the check when doing actual analysis.
Technical details
Implementation notes
GSw_HourlyClusterAlgorithm = 'hierarchical'GSw_HourlyNumClusters = 365Additional changes
cases_test.csv: ChangedPacific_2020(which is mostly covered by other tests) toNY_365to provide an example of running a region with 365 dayscheck_compatibility()fromrunreeds.pytoreeds.checksto keep all the checks togetherIssues resolved
#35
Relevant sources or documentation
The 'optimized' representative day selection + weighting method, and the reasons why it produces a small number of periods when running a small number of zones, are described in https://doi.org/10.1016/j.energy.2025.135830.
Validation, testing, and comparison report(s)
Zero change for USA_defaults: results-v20261030_mainK0_USA_defaults,v20261020_warnK0_USA_defaults.pptx
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