Conversation
demand_limiting_capacity constraint
dalonsoa
requested changes
Aug 19, 2024
Collaborator
dalonsoa
left a comment
There was a problem hiding this comment.
Looks good but very hard to understand the underlying logic - specially in the long term. I suggest you extract the new code as a standalone function and add some dedicated test - can even be a doctest, so it is included with the documentation - illustrating what is going on here and what problem is solving.
Collaborator
Author
|
@dalonsoa I've extracted the code to a new function and created a doctest, as suggested, so hopefully it's clearer now. Also, things started to fail with python 3.12 due to the numpy 2.1 release, so I've had to pin numpy to 2.0 for now. |
dalonsoa
approved these changes
Aug 20, 2024
Collaborator
dalonsoa
left a comment
There was a problem hiding this comment.
I wish all MUSE code had this detailed explanations...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This modifies the demand-limiting capacity constraint to address the issue described in #457. I've added lots of comments to the code so hopefully everything is relatively clear, but happy to have a chat about it if not.
None of the example models are affected, as this only affects certain technologies like refineries that have multiple end-use commodities, but I've tested this with Alaa's Qatar model and the results look reasonable.
Fixes #457
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.
Key checklist
$ python -m pytest$ python -m sphinx -b html docs docs/buildFurther checks