Skip to content

Commit

Permalink
Merge branch 'develop' into geopandas_1
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranz13 authored Aug 9, 2024
2 parents 37f2216 + e8d5b5b commit 3421b51
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 860 deletions.
11 changes: 8 additions & 3 deletions pandapower/plotting/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,9 +1012,12 @@ def create_vsc_collection(net, vscs=None, picker=False, size=None, infofunc=None
vscs = get_index_array(vscs, net.vsc.index)

if bus_geodata is None:
bus_geodata = net["bus_geodata"]
# bus_geodata = net["bus_geodata"]
bus_geodata = net.bus.geo.dropna()

if bus_dc_geodata is None:
bus_dc_geodata = net["bus_dc_geodata"]
# bus_dc_geodata = net["bus_dc_geodata"]
bus_dc_geodata = net.bus_dc.geo.dropna()

in_geodata = (net.vsc.bus.loc[vscs].isin(bus_geodata.index) &
net.vsc.bus_dc.loc[vscs].isin(bus_dc_geodata.index))
Expand Down Expand Up @@ -1093,10 +1096,12 @@ def create_vsc_connection_collection(net, vscs=None, bus_geodata=None, bus_dc_ge
vscs = get_index_array(vscs, net.vsc.index)

if bus_geodata is None:
bus_geodata = net["bus_geodata"]
# bus_geodata = net["bus_geodata"]
bus_geodata = net.bus.geo.dropna()

if bus_dc_geodata is None:
bus_dc_geodata = net["bus_dc_geodata"]
bus_dc_geodata = net.bus_dc.geo.dropna()

in_geodata = (net.vsc.bus.loc[vscs].isin(bus_geodata.index) &
net.vsc.bus_dc.loc[vscs].isin(bus_dc_geodata.index))
Expand Down
4 changes: 4 additions & 0 deletions pandapower/plotting/patch_makers.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ def vsc_patches(coords, size, **kwargs):
linewidths = kwargs.get("linewidths", 2.)
linewidths = get_linewidth_list(linewidths, len(coords), name_entries="vscs")
squares, lines = list(), list()

# load and extract the coords from the geojson object
coords = list(map(lambda x: list(geojson.utils.coords(geojson.loads(x))), coords))

for i, (p1, p2) in enumerate(coords):
p1 = np.array(p1)
p2 = np.array(p2)
Expand Down
999 changes: 142 additions & 857 deletions tutorials/FACTS.ipynb

Large diffs are not rendered by default.

0 comments on commit 3421b51

Please sign in to comment.