Skip to content

Disallow process parameters/flows/availabilities from varying by year - #1488

Open
tsmbland wants to merge 10 commits into
mainfrom
process_params_by_year
Open

Disallow process parameters/flows/availabilities from varying by year#1488
tsmbland wants to merge 10 commits into
mainfrom
process_params_by_year

Conversation

@tsmbland

@tsmbland tsmbland commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Description

We currently allow process parameters, flows and availabilities to vary by year, which allows users to capture the real-world phenomenon of technologies changing over time. However, this isn't strictly required, as users could alternatively define a set of technology "vintages" as distinct processes in MUSE, and use the start_year and end_year fields to define the range of years over which each vintage can be commissioned. The benefit of the current approach is that it's slightly easier for users to change a single parameter over time without having to duplicate a load of data, but there are downsides with the current approach:

  • confusing input data format (commission_years column)
  • extra validation required to make sure the input data is consistent/complete
  • rather nuanced issue discussed in Equalise equivalent assets in dispatch #1477 that you can look at if interested

Overall, mostly driven by the last point, we've decided to drop this feature. If users want to vary process parameters by year, they should create distinct processes (e.g. WNDFRM_2030, WNDFRM_2040).

This simplifies the data structures a bit, and also lets us remove some input validation checks that are no longer required. For example validate_secondary_flows can be removed entirely, and the graph validation can be simplified

Fixes #1489

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 Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.09859% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.06%. Comparing base (bd753de) to head (4efc49e).

Files with missing lines Patch % Lines
src/asset.rs 57.14% 3 Missing ⚠️
src/input/process/parameter.rs 57.14% 0 Missing and 3 partials ⚠️
src/input/process.rs 0.00% 0 Missing and 2 partials ⚠️
src/graph.rs 66.66% 1 Missing ⚠️
src/graph/validate.rs 88.88% 1 Missing ⚠️
src/input/process/flow.rs 95.00% 0 Missing and 1 partial ⚠️
src/process.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1488      +/-   ##
==========================================
+ Coverage   90.02%   90.06%   +0.04%     
==========================================
  Files          60       60              
  Lines        8558     8435     -123     
  Branches     8558     8435     -123     
==========================================
- Hits         7704     7597     -107     
+ Misses        535      521      -14     
+ Partials      319      317       -2     

☔ 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.

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

This PR removes support for process parameters, flows, and availability constraints varying by commissioning year, standardising these inputs to vary only by region. It updates the core Process data structures and downstream graph/validation logic accordingly, and refreshes the input schemas and bundled example models to match the new CSV formats.

Changes:

  • Change process parameter/flow/activity-limit maps from (RegionID, year) keys to RegionID keys only, and update input readers accordingly.
  • Introduce/rename process year checks (can_be_commissioned_in_year, can_operate) and update graph validation/flow lookup to use lifetime-aware operation logic.
  • Update input schemas and example CSVs to remove the commission_years column.

Reviewed changes

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

Show a summary per file
File Description
src/simulation/prices.rs Updates test helpers to build region-keyed process maps (no year dimension).
src/simulation.rs Updates candidate asset filtering to use the renamed commissioning-year predicate.
src/process.rs Changes map key types to be region-only; adds can_operate and renames commissioning check.
src/input/process/parameter.rs Removes year parsing from parameters input; enforces region coverage.
src/input/process/flow.rs Removes year parsing from flows input; validates flows per region and infers primary output per region.
src/input/process/availability.rs Removes year parsing from availabilities input; constructs activity limits per region.
src/input/process.rs Wires updated readers that no longer require milestone years for flows/parameters.
src/input/asset.rs Updates asset validation to require region entries in parameters/flows (not region+year).
src/input/agent/search_space.rs Updates process filtering to use renamed commissioning-year predicate.
src/graph/validate.rs Updates activity feasibility logic to use can_operate + region-keyed limits.
src/graph.rs Updates flow selection for region/year graphs using lifetime-aware operation check.
src/fixture.rs Updates fixtures to build region-keyed maps; suppresses now-unused macro warnings.
src/asset.rs Updates commissioning-year validation call-site to renamed method (but messaging still says “operate”).
schemas/input/process_parameters.yaml Removes commission_years field; updates notes to region-only.
schemas/input/process_flows.yaml Removes commission_years field; updates notes to region-only.
schemas/input/process_availabilities.yaml Removes commission_years field (notes still mention year in one place).
schemas/input/assets.yaml Updates lifetime wording now that lifetime no longer varies by commissioning year.
examples/two_regions/process_parameters.csv Removes commission_years column from example inputs.
examples/two_regions/process_flows.csv Removes commission_years column from example inputs.
examples/two_regions/process_availabilities.csv Removes commission_years column from example inputs.
examples/two_outputs/process_parameters.csv Removes commission_years column from example inputs.
examples/two_outputs/process_flows.csv Removes commission_years column from example inputs.
examples/two_outputs/process_availabilities.csv Removes commission_years column from example inputs.
examples/simple/process_parameters.csv Removes commission_years column from example inputs.
examples/simple/process_flows.csv Removes commission_years column from example inputs.
examples/simple/process_availabilities.csv Removes commission_years column from example inputs.
examples/muse1_default/process_parameters.csv Removes commission_years column from example inputs.
examples/muse1_default/process_flows.csv Removes commission_years column from example inputs.
examples/muse1_default/process_availabilities.csv Removes commission_years column from example inputs.
examples/missing_commodity/process_parameters.csv Removes commission_years column from example inputs.
examples/missing_commodity/process_flows.csv Removes commission_years column from example inputs.
examples/missing_commodity/process_availabilities.csv Removes commission_years column from example inputs.
examples/circularity/process_parameters.csv Removes commission_years column from example inputs.
examples/circularity/process_flows.csv Removes commission_years column from example inputs.
examples/circularity/process_availabilities.csv Removes commission_years column from example inputs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/input/process/parameter.rs
Comment thread src/input/process/flow.rs
Comment thread src/input/process.rs
Comment thread src/input/process/availability.rs
Comment thread schemas/input/process_availabilities.yaml
Comment thread src/asset.rs
@tsmbland
tsmbland marked this pull request as ready for review August 14, 2026 13:48

@dc2917 dc2917 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.

Looks good, seems comprehensive

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.

Disallow process parameters/availabilities/flows from varying by commission year

3 participants