Skip to content

Add min_site_addition_per_year parameter to downscaling#48

Merged
gabezuckerman merged 5 commits into
NatLabRockies:mainfrom
gabezuckerman:feature/min-site-addition-per-year
May 5, 2026
Merged

Add min_site_addition_per_year parameter to downscaling#48
gabezuckerman merged 5 commits into
NatLabRockies:mainfrom
gabezuckerman:feature/min-site-addition-per-year

Conversation

@gabezuckerman

@gabezuckerman gabezuckerman commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

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

  • New config parameter: [min_site_addition_per_year](optional, [float > 0]
  • Post-calibration iterative redistribution loop
  • Fallback: concentrates load onto top-N sites when all are undersized
  • Negative projection year handling
  • Non-negative capacity clamping
  • Tests parametrized with [min_site_addition_per_year] in [1, None]

PS I did this with Claude so let me know if there are any issues...

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
@gabezuckerman gabezuckerman requested a review from ppinchuk as a code owner April 2, 2026 21:59
Copilot AI review requested due to automatic review settings April 2, 2026 21:59

Copilot AI left a comment

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.

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_year across config/CLI/grid plumbing and into downscale_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.

Comment thread reVeal/load.py Outdated
Comment thread reVeal/load.py
Comment thread reVeal/load.py
Comment thread reVeal/load.py
Comment thread reVeal/load.py
Comment thread tests/test_load.py

@ppinchuk ppinchuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some questions/comments

Comment thread reVeal/load.py Outdated
Comment thread reVeal/load.py
Comment thread reVeal/load.py
Comment thread reVeal/load.py
gabezuckerman and others added 3 commits April 30, 2026 08:29
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 ppinchuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok, if it's doing what you want, then we can merge it. We can do some code cleanup later down the road

@gabezuckerman gabezuckerman merged commit 5f6136e into NatLabRockies:main May 5, 2026
10 checks passed
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.

add minimum deployment

3 participants