Skip to content

Conversation

@dalonsoa
Copy link
Collaborator

@dalonsoa dalonsoa commented Jun 24, 2024

Description

Adds a minimum service constraint to the supply calculation, so it is consistent with the constraints used in the investment. This change only affects to the outputs of a couple of examples and tutorials - and only the MCAMetric-related outputs -, but none of the others, still producing the same outputs.

Fixes #335 , identified and further discussed in #321

Why there are two measures of supply instead of using the production calculated by the solver is another question and a matter for a different PR. After this PR is merged, both figures in #321 become the same, and equal to the one on the right.

Type of change

Please add a line in the relevant section of
CHANGELOG.md to
document the change (include PR #) - note reverse order of PR #s.

  • 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

@dalonsoa dalonsoa changed the base branch from develop to max_capacity June 24, 2024 06:17
@dalonsoa dalonsoa requested review from alexdewar and tsmbland June 24, 2024 06:19
@codecov
Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.39%. Comparing base (5aeea97) to head (7b522aa).
Report is 430 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #368      +/-   ##
===========================================
+ Coverage    71.29%   71.39%   +0.10%     
===========================================
  Files           44       44              
  Lines         5880     5894      +14     
  Branches      1159     1162       +3     
===========================================
+ Hits          4192     4208      +16     
+ Misses        1366     1365       -1     
+ Partials       322      321       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dalonsoa dalonsoa marked this pull request as draft June 24, 2024 08:05
@dalonsoa dalonsoa changed the title Min production Min production considered in supply Jun 24, 2024
Copy link
Collaborator

@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.

Seems sensible!

Base automatically changed from max_capacity to develop July 3, 2024 09:24
@dalonsoa
Copy link
Collaborator Author

Not fixing the problem.

@dalonsoa dalonsoa closed this Jul 16, 2024
@tsmbland tsmbland reopened this Oct 17, 2024
@tsmbland tsmbland changed the base branch from develop to v1.3 October 17, 2024 17:14
@tsmbland
Copy link
Collaborator

tsmbland commented Oct 17, 2024

@dalonsoa I still think we should do this. There's no reason not to include the MSF in this function, and as discussed in #423, this function is being used to calculate supply even when using the scipy solver (except, as discussed in #474, when using dispatch_production = "costed")

Long run we'll want to use the outputs directly from the scipy solver rather than using this function, but while we're using this function it might as well do the correct thing

@tsmbland tsmbland marked this pull request as ready for review October 17, 2024 17:42
@tsmbland tsmbland changed the base branch from v1.3 to v1.2.2 October 18, 2024 08:29
@tsmbland tsmbland merged commit 208e994 into v1.2.2 Oct 18, 2024
14 checks passed
@tsmbland tsmbland deleted the min_production branch October 18, 2024 15:41
@tsmbland tsmbland mentioned this pull request Oct 25, 2024
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.

Fix the supply function in quantities.py to impose minimum constraint

4 participants