From 4ed865759a6a9749603220918169ce4bf8da260c Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Fri, 3 Apr 2026 15:23:47 +0200 Subject: [PATCH] debug --- src/View/MainWindow.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index 3cf6f6bd..119a4044 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -1925,7 +1925,6 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): @timer def _diff_results(self, solver1, solver2, solver3, result1, result2): - result3 = Results(study=self._study, solver=solver3) ts = sorted( list( result1.get("timestamps").intersection( @@ -1934,12 +1933,18 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): ) ) - result3 = Results(self._study, solver3) - result4 = Results(self._study, solver1) - result5 = Results(self._study, solver2) + result3 = Results(study=self._study, solver=solver3) + result4 = Results(study=result1.study, solver=solver1) + result4._river = result1._river + result5 = Results(study=result2.study, solver=solver2) + result5._river = result2._river result3.set("nb_reach", result1.get("nb_reach")) + result4.set("nb_reach", result1.get("nb_reach")) + result5.set("nb_reach", result1.get("nb_reach")) result3.set("nb_profile", result1.get("nb_profile")) + result4.set("nb_profile", result1.get("nb_profile")) + result5.set("nb_profile", result1.get("nb_profile")) result3.set("timestamps", ts) result4.set("timestamps", ts) result5.set("timestamps", ts) @@ -1949,27 +1954,27 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): for timestamp in ts: for r in range(int(result1.get("nb_reach"))): + reach3 = result3.river.reach(r) reach1 = result4.river.reach(r) reach2 = result5.river.reach(r) - reach3 = result3.river.reach(r) - for profile1, profile2, profile3 in zip( + for p, (profile1, profile2, profile3) in enumerate(zip( reach1.profiles, reach2.profiles, - reach3.profiles): + reach3.profiles)): for key in ["Z", "Q", "V"]: d1 = profile1.get_ts_key(timestamp, key) d2 = profile2.get_ts_key(timestamp, key) d = d1-d2 reach3.set(p, timestamp, key, d) - reach4.set(p, timestamp, key, d1) - reach5.set(p, timestamp, key, d2) + reach1.set(p, timestamp, key, d1) + reach2.set(p, timestamp, key, d2) if reach1.has_bedload(): d1 = profile1.get_ts_key(timestamp, 'zfd') - reach4.set(p, timestamp, 'zfd', d1) + reach1.set(p, timestamp, 'zfd', d1) if reach2.has_bedload(): d2 = profile2.get_ts_key(timestamp, 'zfd') - reach5.set(p, timestamp, 'zfd', d2) + reach2.set(p, timestamp, 'zfd', d2) if reach1.has_bedload(): d3 = d1-d2 reach3.set(p, timestamp, 'zfd', d3) @@ -1983,9 +1988,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): limits ) limits = profile1.get_ts_key(timestamp, "water_limits") - reach4.set(p, timestamp, "water_limits", limits) + reach1.set(p, timestamp, "water_limits", limits) limits = profile2.get_ts_key(timestamp, "water_limits") - reach5.set(p, timestamp, "water_limits", limits) + reach2.set(p, timestamp, "water_limits", limits) for res in (result3, result4, result5): for r in range(int(res.get("nb_reach"))):