Fix DC junctions in simplify_network#2147
Conversation
|
I had to add a new key, named it
Open question, what to set as default. I believe the closest to replicate old behaviour is to allow mixing of AC and DC, but the technically more correct way would be to set |
| features=features, | ||
| ) | ||
|
|
||
| allow_ac_dc_mix = params.cluster_network.get("allow_ac_dc_mix", False) |
There was a problem hiding this comment.
there shouldn't be a need to set a default here any more since our config validation means there is always a value for this config item in any snakemake run. Adding a default here means you have to maintain the default in two places (the validation config and in this script)
| allow_ac_dc_mix = params.cluster_network.get("allow_ac_dc_mix", False) | |
| allow_ac_dc_mix = params.cluster_network["allow_ac_dc_mix"] |
| def apply_carrier_mixing_policy( | ||
| n: pypsa.Network, busmap: pd.Series, allow_ac_dc_mix: bool | ||
| ) -> pd.Series: | ||
| """Apply carrier mixing policy to a busmap before clustering.""" |
There was a problem hiding this comment.
Extend docstring to describe params and return
| admin_regions["y"] = admin_regions["poi"].y | ||
|
|
||
| busmap_df = pd.DataFrame(busmap) | ||
| busmap_df["admin"] = busmap_df["busmap"].astype(str).str.split("::", n=1).str[0] |
There was a problem hiding this comment.
any possibility that a bus could have :: in it that you didn't put there?
|
I would suggest Not sure the name is expressive enough though. Just looking at the name, one could assume separate synchronous zones (like Balearic Islands, DK etc.) can be clustered / simplified. |

Closes open-energy-transition#275
@brynpickering @euronion
Same bug present in PyPSA-Eur upstream
Changes proposed in this Pull Request
simplify_network(literal edge case example for new UK/Shetland HVDC and multi-terminal setup)Original base network topology

Before fix

remove_stubs: trueremove_stubs: falseAfter fix

remove_stubs: trueremove_stubs: falseChecklist
Required:
doc/release_notes.rst.