diff --git a/src/Solver/Mage.py b/src/Solver/Mage.py index 95f642bf..19802289 100644 --- a/src/Solver/Mage.py +++ b/src/Solver/Mage.py @@ -1117,7 +1117,8 @@ class Mage8(Mage): # Z and Y (4th line) newline() - _ = read_float(3*nb_profile) + tmp = read_float(3*nb_profile) + zfd = tmp[::3] endline() # Data @@ -1332,7 +1333,7 @@ class Mage8(Mage): i_pts = 0 i_data = 0 - # Loop on cross section + # Loop on cross sections for i in range(n): sec_sl = [] reach = ip_to_r(i) diff --git a/src/Solver/RubarBE.py b/src/Solver/RubarBE.py index a20eb0ac..f33b04dc 100644 --- a/src/Solver/RubarBE.py +++ b/src/Solver/RubarBE.py @@ -590,6 +590,8 @@ class Rubar3(CommandLineSolver): # Add results reach to reach list res_reach = results.river.add(i) reachs.append((res_reach, len(reach) + 1)) + results.set("nb_reach", f"{len(reachs)}") + results.set("nb_profile", f"{sum([r[1] - 1 for r in reachs])}") def read_data_line(f): line = f.readline().split() @@ -650,13 +652,16 @@ class Rubar3(CommandLineSolver): set_and_compute_limites(reach, ind, z+h, q, s) @timer - def results(self, study, repertory, qlog=None, name="0"): + def results(self, study, repertory, qlog=None, name=None): results = Results( study=study, solver=self, repertory=repertory, name=name, ) + if name is None: + name = study.name.replace(" ", "_") + results_file = f"profil.{name}" fname = os.path.join(repertory, results_file) diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index c3f0506d..309ed03b 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -1888,7 +1888,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): s3_name = solver1.name + " <> " + solver2.name - if not (scenario2 is None or scenario2 is None): + if not (scenario1 is None or scenario2 is None): study1 = self._study.copy_from_scenario(scenario1) study2 = self._study.copy_from_scenario(scenario2) diff --git a/src/View/Results/CustomPlot/Plot.py b/src/View/Results/CustomPlot/Plot.py index 4749e18f..a68ab914 100644 --- a/src/View/Results/CustomPlot/Plot.py +++ b/src/View/Results/CustomPlot/Plot.py @@ -230,7 +230,7 @@ class CustomPlot(PamhyrPlot): dz = list( map( lambda x, y: x - y, - z_min2, z_min2 + z_min1, z_min2 ) ) line = ax.plot( @@ -646,7 +646,7 @@ class CustomPlot(PamhyrPlot): dz = list( map( lambda x, y: x - y, - z_min2, z_min2 + z_min1, z_min2 ) ) self.lines["bed_elevation"][0].set_ydata(dz)