Skip to content

Update prices in the base year#835

Open
tsmbland wants to merge 7 commits intomainfrom
base_year_prices
Open

Update prices in the base year#835
tsmbland wants to merge 7 commits intomainfrom
base_year_prices

Conversation

@tsmbland
Copy link
Copy Markdown
Collaborator

@tsmbland tsmbland commented Apr 23, 2026

Prices were previously not being updated in the base year, sticking to the values provided in the projections file (or zero if not provided), whereas all subsequent years return endogenously calculated prices (if available).

However, there's no particularly good reason why we can't return endogenous prices for the base year, so in the interests of consistency I've changed this.

I've also tried to clarify the documentation to make it clearer how the projections file is used and the consequences for omitting certain price projections.

You can see the implications of this in the results files for the example models. Apart from changing prices in the first year, this doesn't have any impact, because prices are (with certain exceptions) only used to make investment decisions, and there are no investments in the base year. Still nice to see these numbers, and this will also prevent potentially sharp price changes from the first year to the second year.

With this change there's really no need to provide price projections for commodities that can be produced in the model, except that if they don't have a projection they'll end up with a price of zero until the first time they're actually produced.

tsmbland and others added 3 commits April 23, 2026 18:14
@tsmbland tsmbland changed the title Return endogenous prices in the base year Update prices in the base year Apr 24, 2026
@tsmbland tsmbland marked this pull request as ready for review April 24, 2026 13:46
@tsmbland tsmbland requested a review from Copilot April 24, 2026 13:46
Copy link
Copy Markdown

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

This PR updates the MCA equilibrium loop so that endogenously calculated prices are also applied in the base year (when running in equilibrium mode), instead of leaving base-year prices at the projections/zero defaults, and refreshes the regression “golden” outputs accordingly. It also clarifies projections-file behavior in the docs and fixes a working-directory handling issue in the example-output runner.

Changes:

  • Update equilibrium price-updating logic so base-year prices can be endogenously updated (first iteration) and carried into stored results.
  • Update documentation describing how/when projections are used (and what happens when they’re omitted).
  • Refresh example/tutorial regression outputs and fix run_models.py to run in stable per-example directories and restore CWD.

Reviewed changes

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

Show a summary per file
File Description
src/muse/mca.py Updates equilibrium/run logic so base-year prices are updated (first iteration) and price updates apply to the intended year set.
docs/inputs/projections.rst Clarifies when price projections are optional/required and how missing projections are interpreted.
tests/example_outputs/run_models.py Runs examples in directories relative to the script and restores the previous working directory.
tests/example_outputs/trade/Results/MCAPrices.csv Updates expected base-year prices in regression output.
tests/example_outputs/multiple_agents/Results/MCAPrices.csv Updates expected base-year prices in regression output.
tests/example_outputs/minimum_service/Results/MCAPrices.csv Updates expected base-year prices in regression output.
tests/example_outputs/medium/Results/MCAPrices.csv Updates expected base-year prices in regression output.
tests/example_outputs/default_timeslice/Results/Power_Supply.csv Reorders/updates expected output rows due to regenerated results.
tests/example_outputs/default_timeslice/Results/MCAPrices.csv Updates expected base-year prices in regression output.
tests/example_outputs/default_retro/Results/MCAPrices.csv Updates expected base-year prices in regression output.
tests/example_outputs/default_correlation/Results/MCAPrices.csv Updates expected base-year prices in regression output.
tests/example_outputs/default_adhoc/Results/MCAPrices.csv Updates expected base-year prices in regression output.
tests/example_outputs/default/Results/MCAPrices.csv Updates expected base-year prices in regression output.
docs/tutorial-code/new-decision-metric/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/modify-timing-data/2-modify-time-framework/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/modify-timing-data/1-modify-timeslices/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/min-max-timeslice-constraints/2-max-constraint/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/min-max-timeslice-constraints/1-min-constraint/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/carbon-budget/1-carbon-budget/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/add-service-demand/1-exogenous-demand/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/add-service-demand-subsectors/2-agents/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/add-service-demand-subsectors/1-residential-subsectors/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/add-region/1-new-region/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/add-new-technology/2-scenario/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/add-new-technology/1-introduction/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/add-correlation-demand/1-correlation/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/add-agent/2-multiple-objective/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.
docs/tutorial-code/add-agent/1-single-objective/Results/MCAPrices.csv Updates expected base-year prices in tutorial output.

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

Comment thread src/muse/mca.py Outdated
Comment thread docs/inputs/projections.rst Outdated
tsmbland and others added 3 commits April 24, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants