New asset_capacities.csv file#1302
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1302 +/- ##
==========================================
+ Coverage 89.39% 89.55% +0.16%
==========================================
Files 57 58 +1
Lines 8379 8491 +112
Branches 8379 8491 +112
==========================================
+ Hits 7490 7604 +114
+ Misses 582 571 -11
- Partials 307 316 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR changes the simulation output format by moving time-varying capacity information out of assets.csv into a new asset_capacities.csv, enabling correct tracking of partially decommissioned (divisible) assets while simplifying asset lifecycle representation.
Changes:
- Add a new
asset_capacities.csvoutput (and schema/docs) containing capacity per asset/group per milestone year. - Change
assets.csvto emit only newly commissioned asset definitions (one row per divisible group) and dropdecommission_year/capacitycolumns. - Remove explicit “decommissioned” asset state tracking and update decommissioning logic/output writing accordingly.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/simulation.rs |
Writes only newly commissioned asset definitions and writes per-year capacity snapshots via the new writer API. |
src/output.rs |
Adds asset_capacities.csv writer + row type; changes asset writing to append and to emit one row per divisible group. Includes a new unit test for capacity output. |
src/asset/pool.rs |
Refactors commissioning/decommissioning APIs (return newly commissioned assets; drop decommissioned collection) and updates unit tests accordingly. |
src/asset.rs |
Removes AssetState::Decommissioned and related decommission APIs/tests; keeps parent/child mechanics for divisible assets. |
schemas/output/assets.yaml |
Updates assets.csv schema to reflect new columns/semantics and removal of decommission/capacity fields. |
schemas/output/asset_capacities.yaml |
Adds schema for the new asset_capacities.csv output. |
docs/file_formats/generate_docs.py |
Adds asset_capacities to the documented output file order. |
tests/data/**/assets.csv |
Updates regression golden files for the new assets.csv format. |
tests/data/**/asset_capacities.csv |
Adds regression golden files for the new asset_capacities.csv output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This breaks the capacity data from the existing
assets.csvoutput file to a new fileasset_capacities.csv. This only really has implications for divisible assets which can decrease in capacity over time. For these, we now have a single row inassets.csvrepresenting the parent (rather than rows for each child asset), and you can track the overall capacity over time inasset_capacities.csv. For non-divisible assets, capacities will just be flat until in eventually gets decommissioned, at which point it will disappear from the file.One challenge was how to add the appropriate assets to the
assets.csvfile each year so everything is covered and we don't get duplicate rows. This needs to include newly selected assets and assets from theassets.csvinput file. The latter may include assets that get decommissioned straight away, which never exist in the asset pool at the same time as newly selected assets, so there was some fiddly work to keep track of the assets that we need to add to the file. It works, but it's a bit hacky.Beyond just the output files, there are a few wider implications:
decommission_yearcolumn fromassets.csvas users can track decommissioning/partial decommissioning via theasset_capacities.csvfileassets.csvfile each year just to update the now-removeddecommission_yearcolumndecommission_year. This means we can remove thedecommissionedpool fromAssetPool, and can remove theAssetState::DecommissionedstateFixes #1245
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks