Skip to content

Report mothballed capacity - #1506

Merged
tsmbland merged 1 commit into
mainfrom
mothballed_capacity
Aug 25, 2026
Merged

Report mothballed capacity#1506
tsmbland merged 1 commit into
mainfrom
mothballed_capacity

Conversation

@tsmbland

@tsmbland tsmbland commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds columns for mothballed_capacity and mothballed_units to asset_capacities.csv, allowing users to see information about capacity mothballing. Most example models have mothball_years = 0 (essentially mothballing is turned off), so this just adds columns full of zeros, but the simple_mothball has some real mothballing data in these columns.

Fixes #1461

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 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.31%. Comparing base (b36dd9a) to head (6efdd05).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1506   +/-   ##
=======================================
  Coverage   90.30%   90.31%           
=======================================
  Files          60       60           
  Lines        8658     8663    +5     
  Branches     8658     8663    +5     
=======================================
+ Hits         7819     7824    +5     
  Misses        525      525           
  Partials      314      314           

☔ 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

Adds mothballed capacity and unit counts to asset_capacities.csv, with schema, release-note, code, and regression fixture updates.

Changes:

  • Calculates and outputs mothballing metrics.
  • Updates the output schema and release notes.
  • Refreshes regression fixtures, including non-zero mothballing data.

Reviewed changes

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

Show a summary per file
File Description
tests/data/two_regions/asset_capacities.csv Updated regression fixture.
tests/data/two_outputs/asset_capacities.csv Updated regression fixture.
tests/data/simple/asset_capacities.csv Updated regression fixture.
tests/data/simple_unit_size/asset_capacities.csv Updated regression fixture.
tests/data/simple_shadow/asset_capacities.csv Updated regression fixture.
tests/data/simple_npv/asset_capacities.csv Updated regression fixture.
tests/data/simple_mothball/asset_capacities.csv Updated fixture with mothballing data.
tests/data/simple_marginal/asset_capacities.csv Updated regression fixture.
tests/data/simple_marginal_average/asset_capacities.csv Updated regression fixture.
tests/data/simple_ironing_out/asset_capacities.csv Updated regression fixture.
tests/data/simple_full/asset_capacities.csv Updated regression fixture.
tests/data/muse1_default/asset_capacities.csv Updated regression fixture.
tests/data/missing_commodity/asset_capacities.csv Updated regression fixture.
tests/data/circularity/asset_capacities.csv Updated regression fixture.
tests/data/circularity_npv/asset_capacities.csv Updated regression fixture.
src/output.rs Writes and tests the new CSV fields.
src/asset.rs Calculates mothballed capacity and unit counts.
schemas/output/asset_capacities.yaml Documents the new output columns.
docs/release_notes/upcoming.md Records the output-format change.

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

@tsmbland
tsmbland marked this pull request as ready for review August 25, 2026 13:12

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

I've a question, but otherwise the code looks good.

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.

So, in this example, the cases where there's mothballed capacity, the whole capacity is mothballed, right? There is no actual capacity not mothballed? Or does it means there is equal capacity mothballed and not?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, in this case all capacity is mothballed

@tsmbland
tsmbland merged commit a3473b6 into main Aug 25, 2026
9 checks passed
@tsmbland
tsmbland deleted the mothballed_capacity branch August 25, 2026 16:03
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.

Show data about mothballing decisions to user

3 participants