Skip to content

Second new tranching approach#1395

Open
tsmbland wants to merge 4 commits into
mainfrom
second_new_tranching_approach
Open

Second new tranching approach#1395
tsmbland wants to merge 4 commits into
mainfrom
second_new_tranching_approach

Conversation

@tsmbland

@tsmbland tsmbland commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Implements the second tranching idea discussed in #1358, which uses a dynamic capacity approach, where candidate asset capacities are set according to annual demand:

capacity = capacity_limit_factor * annual_demand / max_annual_supply_per_capacity

This is similar to the current demand-limiting-capacity approach, but slightly safer as it cannot be throw off by extreme demand/availability values in any particular timeslices.

Also changing capacity_limit_factor to 0.05, as suggested by Adam, but we may change this after more testing

TODO: need to update regression test results, and disallow tests for circularity and circularity_npv as these are failing (much like #1357)

Fixes #1358

Type of change

  • Bug fix (non-breaking change to fix an issue)
  • New feature (non-breaking change to add functionality)
  • Refactoring (non-breaking, non-functional change to improve maintainability)
  • Optimization (non-breaking change to speed up the code)
  • Breaking change (whatever its nature)
  • Documentation (improve or add documentation)

Key checklist

  • All tests pass: $ cargo test
  • The documentation builds and looks OK: $ cargo doc
  • Update release notes for the latest release if this PR adds a new feature or fixes a bug
    present in the previous release

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.77%. Comparing base (3334eb5) to head (ce1fad6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1395      +/-   ##
==========================================
- Coverage   89.42%   86.77%   -2.66%     
==========================================
  Files          58       58              
  Lines        8367     8376       +9     
  Branches     8367     8376       +9     
==========================================
- Hits         7482     7268     -214     
- Misses        564      792     +228     
+ Partials      321      316       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tsmbland tsmbland force-pushed the second_new_tranching_approach branch from ce1fad6 to 4af71c6 Compare July 7, 2026 09:17

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

Implements a revised tranching approach for candidate asset sizing in the investment loop by assigning candidate capacities from an annual-demand-based characteristic capacity scale, then applying capacity_limit_factor as the per-round appraisal fraction.

Changes:

  • Add an annual-demand-based capacity scaling helper and use it to size candidate assets during option generation.
  • Adjust the default capacity_limit_factor (0.1 → 0.05) to reflect the new capacity scaling behaviour.
  • Update the model schema documentation for capacity_limit_factor to describe the new meaning.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/simulation/investment.rs Introduces annual-demand-based candidate capacity scaling and adds tests around the new helper.
src/model/parameters.rs Changes the default value of capacity_limit_factor to align with the new tranching increments.
schemas/input/model.yaml Updates schema docs/default for capacity_limit_factor to match the new candidate sizing approach.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/simulation/investment.rs
Comment thread schemas/input/model.yaml
Comment thread src/model/parameters.rs
Comment on lines 118 to 122
// Default values for optional parameters
allow_dangerous_options: false,
candidate_asset_capacity: Capacity(1e-4),
capacity_limit_factor: Dimensionless(0.1),
capacity_limit_factor: Dimensionless(0.05),
value_of_lost_load: MoneyPerFlow(1e9),
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.

New approach for tranching/divisible assets

2 participants