e2nIEE / simbench

Electrical Power System Benchmark Dataset directly usable with pandapower (use the project website for other tools)
https://simbench.de/en/
Other
102 stars 29 forks source link

Simbench not compatible with Pandapower Collection Plots #39

Closed TheBigFudge closed 7 months ago

TheBigFudge commented 7 months ago

Hey,

i'm stated working with the simbench model. Thank you for all the hard work in creating this package! I have noticed a incompatibility issue, when creating plots with collections (pandapower.plotting.draw_collections).

It seems there is a problem when plotting buses, loads or sgen, so all PatchCollection elements. Plotting LineCollectionElements is working, but as soon as i plot node elements it seems like the coords are not passed correctly. For example when plotting all busses i only get one big circle as plot.

Here is a minimal example code:

import pandapower as pp
import pandapower.networks as nw
import pandapower.plotting as plot
import matplotlib.pyplot as plt

import simbench as sb

net = sb.get_simbench_net("1-MV-rural--0-sw")
# net = nw.mv_oberrhein()
pp.runpp(net)

lc = plot.create_line_collection(net, net.line.index, use_bus_geodata=True)

bc = plot.create_bus_collection(net, net.bus.index)

plot.simple_plot(net)
plot.draw_collections([lc, bc])
plt.show()

This seems to happen with all networks (i tested several LV and MV networks). When changing the net to mv_overrhein everything is working as intended.

SteffenMeinecke commented 7 months ago

@TheBigFudge if you produce a figure where the buses are so big that the last plotted bus overlay all other plottings, than there is just one bus. Try to adjust the size of the buses by, for example bc = plot.create_bus_collection(net, net.bus.index, size=0.0004)

TheBigFudge commented 7 months ago

@SteffenMeinecke thanks for the reply! Adding the size parameter with a smal value fixes the collection plottings for me. Thanks you very much. even if i don't quite understand why you have to scale down the size of the nodes manually. shouldn't this happen automatically as with other networks (e.g. MV Oberrhein)?

SteffenMeinecke commented 7 months ago

@TheBigFudge automatic scaling is done in pp.plotting.simple_plot() but if you create a customized plotting collection than you need to take care about the sizes, colors, ...

TheBigFudge commented 7 months ago

@TheBigFudge automatic scaling is done in pp.plotting.simple_plot() but if you create a customized plotting collection than you need to take care about the sizes, colors, ...

thanks for the explanation :)