-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic share constraint bounds #95
Conversation
tests/test_scenario_features.py
Outdated
--------------- | ||
|
||
Seattle canning_plant production (original: 350) is limited to 50% of all | ||
transport_from_san-diego (original: 550). Expected outcome: some increase of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (80 > 79 characters)
note this can also use |
can we split up the tests into multiple files and call them |
Yes, as you wish. In principle, the order of tests should not matter (they should be independent of order). Please feel free to implement as you see fit. |
rebased on most recent hackathon prs. should be good to go at your convenience @danielhuppmann |
message_ix/core.py
Outdated
'kwargs': dict( | ||
idx_sets=['shares', 'node', 'node', 'type_tec', 'mode', | ||
'commodity', 'level', 'year', 'time'], | ||
idx_names=['shares', 'node', 'node_loc', 'type_tec', 'mode', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (84 > 79 characters)
message_ix/core.py
Outdated
'kwargs': dict( | ||
idx_sets=['shares', 'node', 'node', 'type_tec', 'mode', | ||
'commodity', 'level', 'year', 'time'], | ||
idx_names=['shares', 'node', 'node_loc', 'type_tec', 'mode', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (84 > 79 characters)
@danielhuppmann, I took a shot at implementing the first upper bound constraint. I have tests which pass and confirm it works in principle. I'm sure it's ugly, but I think it covers the broad strokes of our discussion today. @OFR-IIASA, this should be ready for testing if you want to go for it. |
message_ix/core.py
Outdated
'type_tec'], | ||
idx_names=['shares', 'commodity', 'level', | ||
'type_tec_share', 'type_tec_total']) | ||
# idx_sets=['shares', 'node', 'node', 'type_tec', 'mode', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E122 continuation line missing indentation or outdented
E501 line too long (80 > 79 characters)
message_ix/core.py
Outdated
idx_names=['shares', 'commodity', 'level', | ||
'type_tec_share', 'type_tec_total']) | ||
# idx_sets=['shares', 'node', 'node', 'type_tec', 'mode', | ||
# 'commodity', 'level', 'year', 'time'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E122 continuation line missing indentation or outdented
message_ix/core.py
Outdated
'type_tec_share', 'type_tec_total']) | ||
# idx_sets=['shares', 'node', 'node', 'type_tec', 'mode', | ||
# 'commodity', 'level', 'year', 'time'], | ||
idx_sets=['shares', 'node', 'node', 'type_tec', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
message_ix/core.py
Outdated
# idx_sets=['shares', 'node', 'node', 'type_tec', 'mode', | ||
# 'commodity', 'level', 'year', 'time'], | ||
idx_sets=['shares', 'node', 'node', 'type_tec', | ||
'mode', 'commodity', 'level'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
message_ix/core.py
Outdated
# 'commodity', 'level', 'year', 'time'], | ||
idx_sets=['shares', 'node', 'node', 'type_tec', | ||
'mode', 'commodity', 'level'], | ||
idx_names=['shares', 'node_share', 'node', 'type_tec', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
message_ix/core.py
Outdated
idx_sets=['shares', 'node', 'node', 'type_tec', | ||
'mode', 'commodity', 'level'], | ||
idx_names=['shares', 'node_share', 'node', 'type_tec', | ||
'mode', 'commodity', 'level']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
message_ix/core.py
Outdated
(s.init_set, { | ||
'args': ('map_shares_commodity_total',), | ||
'kwargs': dict( | ||
idx_sets=['shares', 'node', 'node', 'type_tec', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
message_ix/core.py
Outdated
'args': ('map_shares_commodity_total',), | ||
'kwargs': dict( | ||
idx_sets=['shares', 'node', 'node', 'type_tec', | ||
'mode', 'commodity', 'level'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
message_ix/core.py
Outdated
'kwargs': dict( | ||
idx_sets=['shares', 'node', 'node', 'type_tec', | ||
'mode', 'commodity', 'level'], | ||
idx_names=['shares', 'node_share', 'node', 'type_tec', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
message_ix/core.py
Outdated
idx_sets=['shares', 'node', 'node', 'type_tec', | ||
'mode', 'commodity', 'level'], | ||
idx_names=['shares', 'node_share', 'node', 'type_tec', | ||
'mode', 'commodity', 'level']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
Great PR @danielhuppmann, should we be good to go after docs are included? |
and after stickler is appeased? =P |
want me to make this PR based on an upstream branch so you can commit directly? |
add LaTeX docstrings for generic commodity-share constraints
add LaTeX docstrings for generic commodity-share constraints
add LaTeX docstrings for generic commodity-share constraints
add LaTeX docstrings for generic commodity-share constraints
add LaTeX docstrings for generic commodity-share constraints
Here's the start of a test @danielhuppmann
Please confirm that this PR has done the following:
Adding to RELEASE_NOTES.md
Please add a single line in the release notes similar to the following: