Skip to content

Comments

Fix bug in demand_share module#632

Merged
tsmbland merged 3 commits intomainfrom
demand_share_bug
Jan 17, 2025
Merged

Fix bug in demand_share module#632
tsmbland merged 3 commits intomainfrom
demand_share_bug

Conversation

@tsmbland
Copy link
Collaborator

@tsmbland tsmbland commented Jan 17, 2025

Description

Only spotted this because of the refactor in #631

There was a mistake in the new_consumption function. It was passing current market data to unmet_demand. However, this should be calculating unmet demand by existing assets in the investment year (not the current year). There are still things I don't understand about this function, but this seems obviously wrong so needs to be fixed.

All of the results have changed, but the changes seems small and everything still looks reasonable to me. The only model that looks a bit different is the carbon budget tutorial. Not sure about this, but will probably just have to play around with that model to see what's going on. I can't see anything incorrect about the changes in this PR

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass: $ python -m pytest
  • The documentation builds and looks OK: $ python -m sphinx -b html docs docs/build

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@tsmbland tsmbland marked this pull request as ready for review January 17, 2025 10:30
@tsmbland tsmbland merged commit be58f89 into main Jan 17, 2025
14 checks passed
@tsmbland tsmbland deleted the demand_share_bug branch January 17, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant