Fix bug: Transformer type handling in stochastic networks#1499
Merged
Fix bug: Transformer type handling in stochastic networks#1499
Conversation
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.
Closes #1496
Changes proposed in this Pull Request
When using transformer types in stochastic networks,
apply_transformer_types()failed with because it was not handling multiindex with scenarios when matching data with transformer_types table.Fix is to drop scenarios & look at unique transformer types. User changes across type data are caught by the consistency checks.
Small history on this: when preparing #1154 we did think about problem of types broadcasting, and had exactly this fix implemented, which was reverted before merge since we universally agreed types should ideally not be broadcasted with scenarios (w/o re-applying the fix). Problems of this kind will go with #1474
@gincrement thanks for putting attention to this. One question, in your version you've included "tap_ratio" into a copy of transformers data: https://github.com/PyPSA/PyPSA/compare/master...gincrement:pypsa:patch-9?diff=split&w#diff-4d3697f16fbe48a31c279ea3a292649b3c6a62aebe09e837b34c35674af6e30bR484. I don't see a reason for doing this, since tap_ratio is created fresh later in function and not extracted from either table. Do I miss something?
Checklist
docs.docs/release-notes.mdof the upcoming release is included.