Skip to content

Change default pricing strategy to "full_average"#1281

Merged
tsmbland merged 9 commits into
mainfrom
default_pricing_strategy
May 13, 2026
Merged

Change default pricing strategy to "full_average"#1281
tsmbland merged 9 commits into
mainfrom
default_pricing_strategy

Conversation

@tsmbland
Copy link
Copy Markdown
Collaborator

@tsmbland tsmbland commented May 12, 2026

Description

Changes the default strategy for SED/SVD commodities from "shadow" to "full_average".

Since this strategy isn't yet supported for commodities involved in circularities, I've modified the "circularities" example model to revert to "shadow" pricing for electricity and hydrogen. I also had to widen the capacity_margin to get this model to run - not necessarily surprising since the new pricing strategy changes investment choices so the cycle balancing is working on a different system. I've added a note about both of these in the model's README.

While I was at it, I re-enabled the regression test for "two_regions" on mac - it works now (not that the underlying problem is fixed (#1174), we've just changed the model so the problem no longer reveals itself)

Fixes #1173
Fixes #1197

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
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.46%. Comparing base (877c0d9) to head (5777372).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1281      +/-   ##
==========================================
- Coverage   89.57%   89.46%   -0.11%     
==========================================
  Files          57       57              
  Lines        8361     8361              
  Branches     8361     8361              
==========================================
- Hits         7489     7480       -9     
- Misses        571      581      +10     
+ Partials      301      300       -1     

☔ View full report in Codecov by Sentry.
📢 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 marked this pull request as ready for review May 13, 2026 08:58
Copilot AI review requested due to automatic review settings May 13, 2026 08:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates MUSE2’s default commodity pricing behavior by switching SED/SVD commodities from shadow pricing to full_average pricing, and refreshes example/regression artifacts to match the resulting model outputs. This aligns the out-of-the-box behavior with the intended newer pricing approach while keeping the circularity example runnable by overriding pricing where circular dependencies exist.

Changes:

  • Switched the default PricingStrategy for SED/SVD commodities to FullCostAverage (full_average in inputs).
  • Updated the circularity example to explicitly use shadow pricing for circular commodities and widened capacity_margin.
  • Refreshed regression expected outputs and re-enabled the two_regions regression test across architectures.

Reviewed changes

Copilot reviewed 39 out of 43 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/input/commodity.rs Changes default pricing strategy for SED/SVD commodities to FullCostAverage.
schemas/input/commodities.yaml Updates schema docs to reflect the new default pricing_strategy for SED/SVD.
examples/circularity/README.txt Documents circularity pricing override and capacity_margin adjustment.
examples/circularity/model.toml Sets a wider capacity_margin to ensure the example solves under new defaults.
examples/circularity/commodities.csv Adds per-commodity pricing overrides for circularity-related commodities.
docs/release_notes/upcoming.md Adds a breaking-change release note entry for the new default pricing strategy.
tests/regression.rs Re-enables two_regions regression test on all architectures (removes x86_64 gating).
tests/data/two_regions/commodity_prices.csv Updates expected commodity price outputs for two_regions.
tests/data/two_regions/assets.csv Updates expected asset build-out for two_regions.
tests/data/two_outputs/assets.csv Updates expected asset build-out for two_outputs.
tests/data/simple/debug_solver.csv Updates expected debug solver objective traces for simple.
tests/data/simple/debug_appraisal_results.csv Updates expected appraisal debug outputs for simple.
tests/data/simple/commodity_prices.csv Updates expected commodity prices for simple.
tests/data/simple/assets.csv Updates expected asset build-out for simple.
tests/data/simple_npv/commodity_prices.csv Updates expected commodity prices for simple_npv patched example.
tests/data/simple_npv/assets.csv Updates expected asset build-out for simple_npv patched example.
tests/data/simple_marginal/commodity_prices.csv Updates expected prices for simple_marginal patched example.
tests/data/simple_marginal/commodity_flows.csv Updates expected flows for simple_marginal patched example.
tests/data/simple_ironing_out/commodity_prices.csv Updates expected prices for simple_ironing_out patched example.
tests/data/simple_ironing_out/assets.csv Updates expected assets for simple_ironing_out patched example.
tests/data/simple_full/commodity_prices.csv Updates expected prices for simple_full patched example.
tests/data/simple_full/commodity_flows.csv Updates expected flows for simple_full patched example.
tests/data/simple_divisible/commodity_prices.csv Updates expected prices for simple_divisible patched example.
tests/data/simple_divisible/assets.csv Updates expected assets for simple_divisible patched example.
tests/data/muse1_default/commodity_prices.csv Updates expected prices for muse1_default.
tests/data/muse1_default/assets.csv Updates expected assets for muse1_default.
tests/data/missing_commodity/assets.csv Updates expected assets for missing_commodity.
tests/data/circularity/assets.csv Updates expected assets for circularity example/regression case.

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

Comment thread docs/release_notes/upcoming.md Outdated
Comment thread examples/circularity/commodities.csv Outdated
tsmbland and others added 2 commits May 13, 2026 10:10
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 13, 2026 09:10
@tsmbland tsmbland requested review from Aurashk and alexdewar May 13, 2026 09:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 39 out of 43 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Member

@alexdewar alexdewar left a comment

Choose a reason for hiding this comment

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

I skimmed the output files, but haven't gone through them in detail. Hopefully there isn't anything too wacky in there... If so, I guess we'll catch it further down the line! Adam mentioned he was going to look at it in more detail with someone in the summer.

Anyway, I'm happy with all this in principle. It's nice that we can unhide that regression test now on macs too.

@tsmbland tsmbland enabled auto-merge May 13, 2026 12:06
@tsmbland tsmbland merged commit 0af4399 into main May 13, 2026
8 checks passed
@tsmbland tsmbland deleted the default_pricing_strategy branch May 13, 2026 12:09
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.

Regression test disabled on macos Change default pricing strategy for SED+SVD commodities

3 participants