Skip to content

Modify patch tests for pricing strategies#1324

Open
tsmbland wants to merge 3 commits into
mainfrom
pricing_patches
Open

Modify patch tests for pricing strategies#1324
tsmbland wants to merge 3 commits into
mainfrom
pricing_patches

Conversation

@tsmbland
Copy link
Copy Markdown
Collaborator

@tsmbland tsmbland commented Jun 2, 2026

I forgot to do this with #1281, but since we modified the default pricing strategy (from "shadow" to "full_average") we also need to modify the patch tests so they properly cover the remaining strategies in a targeted way

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.51%. Comparing base (b00af32) to head (106ba19).
⚠️ Report is 50 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1324   +/-   ##
=======================================
  Coverage   89.51%   89.51%           
=======================================
  Files          58       58           
  Lines        8537     8537           
  Branches     8537     8537           
=======================================
  Hits         7642     7642           
  Misses        580      580           
  Partials      315      315           

☔ 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 June 2, 2026 10:08
Copilot AI review requested due to automatic review settings June 2, 2026 10:08
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 regression patch tests and their expected outputs to reflect the new default pricing strategy (full_average), while keeping targeted coverage of the non-default pricing strategies via patches.

Changes:

  • Replace the simple_full_average patched regression test with a new simple_shadow patch test (electricity priced using shadow prices).
  • Update patch definitions to leave most commodities on the default strategy (blank/omitted pricing_strategy) and only override the commodity under test.
  • Regenerate/update regression CSV fixtures across affected example datasets to match the new pricing defaults and resulting model outputs.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/example/patches.rs Renames/removes the old full-average patch and defines the new simple_shadow patch; updates patched commodity pricing_strategy columns to rely on defaults where appropriate.
tests/regression.rs Swaps patched regression coverage from simple_full_average to simple_shadow.
tests/data/two_regions/commodity_flows.csv Updates expected two-regions flows (minor float diffs) after pricing default change.
tests/data/simple/debug_solver.csv Updates expected objective values in debug output (minor float diffs).
tests/data/simple/commodity_flows.csv Updates expected simple model flows (minor float diffs).
tests/data/simple_npv/commodity_flows.csv Updates expected simple_npv flows (minor float diffs).
tests/data/simple_marginal/commodity_prices.csv Updates expected prices for the marginal-electricity patched case under the new defaults.
tests/data/simple_marginal/commodity_flows.csv Updates expected flows for the marginal-electricity patched case.
tests/data/simple_marginal/assets.csv Updates expected asset build-out for the marginal-electricity patched case.
tests/data/simple_marginal/asset_capacities.csv Updates expected capacities for the marginal-electricity patched case.
tests/data/simple_marginal_average/commodity_prices.csv Updates expected prices for the marginal-average-electricity patched case under the new defaults.
tests/data/simple_marginal_average/assets.csv Updates expected assets for the marginal-average-electricity patched case.
tests/data/simple_marginal_average/asset_capacities.csv Updates expected capacities for the marginal-average-electricity patched case.
tests/data/simple_ironing_out/commodity_flows.csv Updates expected flows for the ironing-out patched case (minor float diffs).
tests/data/simple_full/commodity_prices.csv Updates expected prices for the full-cost gas patched case under the new defaults.
tests/data/simple_full/commodity_flows.csv Updates expected flows for the full-cost gas patched case (minor float diffs).
tests/data/simple_divisible/commodity_flows.csv Updates expected flows for the divisible-process patched case (minor float diffs).
tests/data/muse1_default/commodity_flows.csv Updates expected flows for muse1_default (minor float diffs).
tests/data/missing_commodity/commodity_flows.csv Updates expected flows for missing_commodity (minor float diffs).
tests/data/simple_shadow/commodity_prices.csv Adds expected prices for the new shadow-electricity patched case.
tests/data/simple_shadow/commodity_flows.csv Adds expected flows for the new shadow-electricity patched case.
tests/data/simple_shadow/assets.csv Adds expected assets for the new shadow-electricity patched case.
tests/data/simple_shadow/asset_capacities.csv Adds expected capacities for the new shadow-electricity patched case.

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

Comment thread src/example/patches.rs
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.

2 participants