Disallow process parameters/flows/availabilities from varying by year - #1488
Disallow process parameters/flows/availabilities from varying by year#1488tsmbland wants to merge 10 commits into
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 toRegionIDkeys 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_yearscolumn.
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.
dc2917
left a comment
There was a problem hiding this comment.
Looks good, seems comprehensive
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_yearandend_yearfields 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:commission_yearscolumn)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_flowscan be removed entirely, and the graph validation can be simplifiedFixes #1489
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks