This fixes the conversion for the roundtrip PyPSA -> PSD -> PyPSA.
Test it with
from powersimdata.input.converter.pypsa_to_grid import FromPyPSA
from powersimdata.network.europe_tub.model import TUB
from powersimdata.input.exporter.export_to_pypsa import export_to_pypsa
from pandas.testing import assert_frame_equal
tub = TUB("Europe", reduction=1024)
tub.build()
g = FromPyPSA(tub.network)
n = export_to_pypsa(g)
for c in n.iterate_components():
if c.name in ['Carrier']:
continue
orig = tub.df(c.name)
conv = c.df
assert_frame_equal(conv[orig.columns].head(), orig.head())
Missing points:
The distinction between Stores and StorageUnits is not yet completed
The carrier roundtrip conversion is not complete as it depends on internal static data on PSD side.
This fixes the conversion for the roundtrip PyPSA -> PSD -> PyPSA.
Test it with
Missing points: