e2nIEE / pandapower

Convenient Power System Modelling and Analysis based on PYPOWER and pandas
https://www.pandapower.org
Other
844 stars 478 forks source link

from_json() does not convert net.bus_geodata and net.line_geodata from stored (older) files #2335

Open SteffenMeinecke opened 2 months ago

SteffenMeinecke commented 2 months ago

[Uploading v2.14.6_net.json…]()

Bug report checklis

Reproducible Example

import pandapower as pp
net = pp.from_json("v2.14.6_net.json")
print(net)
print(net.bus_geodata.head())
print(net.bus.geo.head())
print(net.line.geo.head())

Issue Description and Traceback

convert_format() needs to be extended.

Expected Behavior

geo data should be converted to the new columns net.bus.geo and net.line.geo. Instead the data still is in the old dataframes bus_geodata and line_geodata.

Installed Versions

Label

SteffenMeinecke commented 1 month ago

case9.json Attached is a case9 json file with net.bus_geodata of a former pp version. Using the following code, I don't see the expected output. @KS-HTK @vogt31337 shouldn't this be fixed by above PR merged?

import pandapower as pp
net = pp.from_json(sm.pjoin(sm.desktop, "case9.json"))
if bus_geodata_exists := "bus_geodata" in net.keys():
    print(net.bus_geodata)
    print("net.bus_geodata should not exist anymore.")
if net_bus_geo_is_all_nan := net.bus.geo.isnull().all():
    print("Instead, net.bus.geo is all NaN.")
if not bus_geodata_exists and not net_bus_geo_is_all_nan:
    print("Bus geo data seems to be converted to the current format. Please ensures this also for net.line.geo.")