Update opf.py for spillage variables#3
Merged
nworbmot merged 1 commit intoPyPSA:masterfrom Mar 30, 2016
jdedecca:master
Merged
Conversation
Member
|
Hi, this was a Python 2 versus Python 3 issue (pyomo doesn't seem to deal with iterators gracefully) - thanks for the heads up and sorry for the Easter-related delay in pulling it. Ideally we need a unit test that uses the inflow/spillage so that we would have caught this. |
Contributor
Author
|
Glad to help! Indeed more test cases would be useful - I'll be using inflows regularly so may keep an eye out on it in future versions. |
FabianHofmann
added a commit
that referenced
this pull request
Oct 16, 2025
- Add Network.unique_carriers property to collect all carriers from components - Create Carriers.assign_colors() method for flexible color assignment - Refactor add_missing_carriers() to use new assign_colors() method - Simplify API: replace assign_colors/color_palette params with single palette param - Update all tests to match new API (palette instead of assign_colors/color_palette) Addresses review comments #1 and #3: - Issue #1: Create separate assign_colors() method instead of parameters - Issue #3: Add c.unique_carriers property similar to c.ports 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
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.
Pyomo does not recognize the spill_index dictionary tuples, but does recognize it as a list instead.
Not passing it as a list results in the following error (example of storage unit 31, snapshot 0):
ERROR: Constructing component 'storage_p_spill_index' from data=None failed:
File "C:\Anaconda3\lib\site-packages\pypsa\opf.py", line 768, in network_lopf
ValueError: The value=('31', 0) is a tuple for set=storage_p_spill_index, which has dimen=1