From d0a8f369efbae9a811c7afeeffb4662657834f90 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Fri, 26 Jun 2026 11:16:16 +0200 Subject: [PATCH] Results: PlotH: Use np table. --- src/View/Results/PlotH.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/View/Results/PlotH.py b/src/View/Results/PlotH.py index e40c132b..f501ed66 100644 --- a/src/View/Results/PlotH.py +++ b/src/View/Results/PlotH.py @@ -128,14 +128,19 @@ class PlotH(PamhyrPlot): self.draw_current() self._init = True + @timer def draw_data(self, res_id): results = self.results[res_id] reach = results.river.reach(self._current_reach_id) + + q = results.get("table")["Q"] + for i, p in enumerate(self._current_profile_id): profile = reach.profile(p) x = self._timestamps - y = profile.get_key("Q") + y = q[:, profile.global_index] + # y = profile.get_key("Q") if res_id == 2: label = "Δ " + self.label_discharge + f" {profile.name}" @@ -187,6 +192,7 @@ class PlotH(PamhyrPlot): lw=1., ) + @timer def draw_max(self, res_id): results = self.results[res_id] reach = results.river.reach(self._current_reach_id) @@ -198,16 +204,21 @@ class PlotH(PamhyrPlot): x = self._timestamps y = [] + q_table = results.get("table")["Q"] + if res_id == 2: label = "Δ " + self.label_discharge_max else: label = self.label_discharge_max - for ts in x: + for i, ts in enumerate(x): ts_y = -9999 + for profile in reach.profiles: - q = profile.get_ts_key(ts, "Q") + q = q_table[i, profile.global_index] + # q = profile.get_ts_key(ts, "Q") ts_y = max(ts_y, q) + y.append(ts_y) m, = self.canvas.axes.plot(