Add min_site_addition_per_year parameter to downscaling#48
Merged
gabezuckerman merged 5 commits intoMay 5, 2026
Merged
Conversation
Adds a minimum threshold for per-site load additions during downscaling. After bootstrapping and calibration, sites receiving less than the minimum are zeroed out and their load is redistributed to remaining sites. When all sites fall below the threshold, load is concentrated onto the highest-priority sites. Also handles negative projection years by distributing load decreases proportionally, and clamps developable capacity to prevent negative propagation. Closes NatLabRockies#41
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a min_site_addition_per_year option to the downscaling workflow to avoid unrealistically small per-site annual additions by zeroing undersized sites and redistributing their load, with additional handling for negative projected load and capacity clamping.
Changes:
- Introduces
min_site_addition_per_yearacross config/CLI/grid plumbing and intodownscale_total/downscale_regional. - Implements post-calibration iterative redistribution enforcing a per-step minimum and a fallback that concentrates load onto top sites.
- Updates tests/config validation and adds targeted assertions for the minimum-addition behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_load.py | Parametrizes tests for the new min-addition feature and adds assertions for minimum-threshold behavior. |
| tests/config/test_downscale.py | Extends config validation tests to include the new min_site_addition_per_year parameter. |
| reVeal/load.py | Implements min-addition redistribution, negative projected load handling, and capacity clamping in downscaling logic. |
| reVeal/grid.py | Wires min_site_addition_per_year from config into downscaling calls. |
| reVeal/config/downscale.py | Adds min_site_addition_per_year to the downscale configuration schema. |
| reVeal/cli/downscale.py | Adds CLI argument plumbing and documentation for min_site_addition_per_year. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ppinchuk
reviewed
Apr 29, 2026
ppinchuk
left a comment
Collaborator
There was a problem hiding this comment.
Some questions/comments
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… _developable_capacity_inc and redistributing the excess to non-overbuilt sites (or, if that’s impossible, raise an error even when min_site_addition_per_year is set) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ppinchuk
approved these changes
May 4, 2026
ppinchuk
left a comment
Collaborator
There was a problem hiding this comment.
ok, if it's doing what you want, then we can merge it. We can do some code cleanup later down the road
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a minimum threshold for per-site load additions during downscaling. After bootstrapping and calibration, sites receiving less than the minimum are zeroed out and their load is redistributed to remaining sites. When all sites fall below the threshold, load is concentrated onto the highest-priority sites.
Closes #41
min_site_addition_per_year](optional, [float > 0]min_site_addition_per_year] in [1, None]PS I did this with Claude so let me know if there are any issues...