Multilinks with 'bus2' throw Error after switching to newest release

40 views
Skip to first unread message

Hannes Koch

unread,
Apr 25, 2025, 9:17:50 AMApr 25
to pypsa
Hi dear group,

I am trying to run a network with some multi-links after switching to Python 3.13 and PyPSA 0.34.1 and I get the following error:

pypsa.consistency.ConsistencyError: The following links have buses which are not defined:
Index(['hp_2018', 'eb_2018', 'gb_2018', 'h2b_2018', 'pb_2018', 'wit_2018', 'hp_2035', 'eb_2035', 'gb_2035', 'h2b_2035', 'pb_2035', 'wit_2035', 'hp_2045', 'eb_2045', 'gb_2045', 'h2b_2045', 'pb_2045', 'wit_2045'],
dtype='object', name='Link')

It lists only the links that connect only to 'bus0' and 'bus1' and have NaNs for 'bus2'. Not specifying 'bus2' for non-Multilinks used to work fine but in the current version it is treated as an inconsistency. Is there a new correct way to lay out Multi-Link components and/or additional bus columns in the links-DataFrame that I am not aware of? The screenshot shows the link-DataFrame with the 'bus2' column on the right, where only for Multi-links a bus is specified.

sceenshot.jpg

I have a bit of an odyssey behind me that includes trying out three different Python versions and switching from Miniconda and condaforge to PiPy - In case this information is helpful, I will gladly provide details.

Any help is greatly appreciated!

Best regards,
Hannes



Hannes Koch

unread,
Apr 25, 2025, 9:18:31 AMApr 25
to pypsa
PS: Opening the image in a new tab will show it in a readable size, sorry for the formatting!

Hannes Koch

unread,
Apr 25, 2025, 3:43:41 PMApr 25
to pypsa
Hi again,

I figured it out. In the doc for Multilinks it is suggested to leave empty fields as empty strings ("") or NaNs. It seems like NaNs are no longer supported, replacing them with "" solved my problem.

Regards
Hannes
Reply all
Reply to author
Forward
0 new messages