I have a PyPSA network with multilinks which I defined with the override_component_attrs argument of pypsa.Network.
When exporting and reimporting the network as netcfd or csv folder the non-standard attributes are lost.
Is there a way to keep the additionally defined attributes when exporting?
If you provide the same
override_component_attrsdict that you used to create the network when loading thepypsa.Networkfrom file, the non-standard attributes are loaded as well. (They are always saved, just not loaded as ofpypsa=0.23.0).Instead of duplicating code you can either either carry the
dictover between along with your network:Or you create a common function which you call from your different scripts which creates a
Networkwith the components overwritten and then callpypsa.Network.import_from_<netcdf|csv_folder>(...).