From 6a012d9484ce16a37a60af6416b4ddc227169593 Mon Sep 17 00:00:00 2001 From: Daniel Lohmeier <31214121+dlohmeier@users.noreply.github.com> Date: Wed, 21 Aug 2024 10:25:16 +0200 Subject: [PATCH] in plotting toolbox: specify columns of geodata for which to calculate min / max in distance calculation (#645) --- src/pandapipes/plotting/plotting_toolbox.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pandapipes/plotting/plotting_toolbox.py b/src/pandapipes/plotting/plotting_toolbox.py index 74ae470f..a5f2fc98 100644 --- a/src/pandapipes/plotting/plotting_toolbox.py +++ b/src/pandapipes/plotting/plotting_toolbox.py @@ -39,8 +39,11 @@ def get_collection_sizes(net, junction_size=1.0, ext_grid_size=1.0, sink_size=1. :type heat_consumer_size: float, default 1. :return: sizes (dict) - dictionary containing all scaled sizes """ - mean_distance_between_junctions = sum((net['junction_geodata'].max() - net[ - 'junction_geodata'].min()).dropna() / 200) + mean_distance_between_junctions = sum( + (np.max(net['junction_geodata'].loc[:, ["x", "y"]].to_numpy(), axis=0) + - np.min(net['junction_geodata'].loc[:, ["x", "y"]].to_numpy(), axis=0)) + / 200 + ) sizes = { "junction": junction_size * mean_distance_between_junctions,