Repository navigation
Conversation
43d9c70 to
2a4cfc5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## prices_refactor #1589 +/- ##
===================================================
+ Coverage 82.02% 82.67% +0.64%
===================================================
Files 69 69
Lines 10037 9986 -51
Branches 10037 9986 -51
===================================================
+ Hits 8233 8256 +23
+ Misses 1527 1452 -75
- Partials 277 278 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b04dc13 to
1395990
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unreplaced seed prices can leak into returned market and fallback maps for cyclic commodities without producers or final-year candidates, publishing stale or zero prices instead of omitting them as documented.
1 open issue
What changed in this PR
Removes shadow and scarcity as user-facing pricing strategies in MUSE2, preparing for optional full-system dispatch while retaining internal shadow prices.
Changes:
- Removes the strategies from pricing logic, input schemas, examples, and regression coverage.
- Seeds cyclic-market pricing with previous-year or previous-iteration prices, defaulting to zero.
- Updates documentation, release notes, fixtures, and pricing callers.
| File | Description |
|---|---|
tests/regression.rs |
Removes the shadow-pricing regression registration. |
tests/data/simple_shadow/commodity_prices.csv |
Deletes obsolete price expectations. |
tests/data/simple_shadow/commodity_flows.csv |
Deletes obsolete flow expectations. |
tests/data/simple_shadow/assets.csv |
Deletes obsolete asset expectations. |
tests/data/simple_shadow/asset_capacities.csv |
Deletes obsolete capacity expectations. |
src/simulation/prices.rs |
Removes pricing strategies and adds previous-price cycle seeding and tests. |
src/simulation/optimisation.rs |
Removes the unused activity-dual map helper. |
src/simulation/activity.rs |
Removes the unused activity-dual map type. |
src/simulation.rs |
Passes previous prices into dispatch pricing. |
src/process.rs |
Updates test commodities to a supported strategy. |
src/input/process/flow.rs |
Updates flow-test pricing strategies. |
src/input/commodity.rs |
Removes scarcity validation and updates a test. |
src/fixture.rs |
Replaces shadow pricing in shared fixtures. |
src/example/patches.rs |
Removes the shadow-pricing example variant. |
src/commodity.rs |
Removes the two pricing-strategy enum variants. |
schemas/input/model.yaml |
Removes unsupported fallback strategies. |
schemas/input/commodities.yaml |
Updates supported strategies and their descriptions. |
docs/release_notes/upcoming.md |
Documents migration requirements and cycle-seeding changes. |
docs/model/prices.md |
Updates pricing and circularity documentation. |
benches/assets.rs |
Supplies empty previous prices for benchmark initialisation. |
Review effort: Balanced
| let seed = previous_prices | ||
| .get(commodity_id, region_id, time_slice) | ||
| .unwrap_or(MoneyPerFlow(0.0)); | ||
| market_prices.insert(commodity_id, region_id, time_slice, seed); |
There was a problem hiding this comment.
To be honest I'm tempted to go the other way. I.e. if a price can't be calculated in the final year, then always fall back to the most recent price, rather than leaving the price empty. I thought we'd planned to do that at one point?
1395990 to
d9d727a
Compare

Description
As described, removing these as user-facing pricing strategies. These require full-system dispatch, which is about to be replaced (or, rather, made optional). Note, the concept of shadow prices still exists, and will be used internally in simulations where full-system dispatch is enabled (which will be turned off by default), but
shadowwill not be exposed as a user-facing pricing strategy.The only other functional change is to price calculation in circularities - previously these were seeded with shadow prices, but this isn't possible any more. Instead, we seed with the previous year prices (or previous round of the ironing out loop), or zero.
Fixes # (issue)
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks