Ensemble: Results: Rename Z to z_mean and dont keep individual result.

scenario-dev-pa
Pierre-Antoine 2026-09-10 10:44:03 +02:00
parent 92990948ad
commit d4d5e26a2b
3 changed files with 19 additions and 25 deletions

View File

@ -1648,16 +1648,13 @@ class Mage8(Mage):
res["q_max"] = np.maximum(q, res["q_max"]) res["q_max"] = np.maximum(q, res["q_max"])
# Keep results min, mean and max # Keep results min, mean and max
res["res_z_min"].append((run_number, np.min(z, axis=0))) # res["res_z_min"].append((run_number, np.min(z, axis=0)))
res["res_z_mean"].append((run_number, np.mean(z, axis=0))) # res["res_z_mean"].append((run_number, np.mean(z, axis=0)))
res["res_z_max"].append((run_number, np.max(z, axis=0))) # res["res_z_max"].append((run_number, np.max(z, axis=0)))
res["res_q_min"].append((run_number, np.min(q, axis=0))) # res["res_q_min"].append((run_number, np.min(q, axis=0)))
res["res_q_mean"].append((run_number, np.mean(q, axis=0))) # res["res_q_mean"].append((run_number, np.mean(q, axis=0)))
res["res_q_max"].append((run_number, np.max(q, axis=0))) # res["res_q_max"].append((run_number, np.max(q, axis=0)))
# FIXME: Keep all results ?
res["traces"].append((run_number, tables))
@timer @timer
def results_ensemble(self, study, repertory, def results_ensemble(self, study, repertory,

View File

@ -155,7 +155,7 @@ class PlotRKCEnsemble(PamhyrPlot):
colors = [ colors = [
("z_min", self.color_plot_ensemble_min), ("z_min", self.color_plot_ensemble_min),
("Z", self.color_plot_ensemble_mean), ("z_mean", self.color_plot_ensemble_mean),
("z_max", self.color_plot_ensemble_max), ("z_max", self.color_plot_ensemble_max),
] ]
@ -263,7 +263,7 @@ class PlotRKCEnsemble(PamhyrPlot):
reach = result.river.reach(self._current_reach_id) reach = result.river.reach(self._current_reach_id)
rk = reach.geometry.get_rk() rk = reach.geometry.get_rk()
z_min = reach.geometry.get_z_min() z_min = reach.geometry.get_z_min()
table = result.get("table")["Z"] table = result.get("table")["z_mean"]
ts = result.get_timestamp_id(self._current_timestamp) ts = result.get_timestamp_id(self._current_timestamp)
gi_0, gi_1 = reach.global_index gi_0, gi_1 = reach.global_index
@ -271,7 +271,7 @@ class PlotRKCEnsemble(PamhyrPlot):
colors = [ colors = [
(0, "z_min", self.color_plot_ensemble_min), (0, "z_min", self.color_plot_ensemble_min),
(1, "Z", self.color_plot_ensemble_mean), (1, "z_mean", self.color_plot_ensemble_mean),
(2, "z_max", self.color_plot_ensemble_max), (2, "z_max", self.color_plot_ensemble_max),
] ]

View File

@ -537,17 +537,12 @@ class SolverLogEnsWindow(SolverLogWindow):
table = {} table = {}
table["Z"] = results.new_table_data("Z", tables["z_mean"])
table["Q"] = results.new_table_data("Q", tables["q_mean"])
table["z_min"] = results.new_table_data("z_min", tables["z_min"])
table["q_min"] = results.new_table_data("q_min", tables["q_min"])
table["z_max"] = results.new_table_data("z_max", tables["z_max"])
table["q_max"] = results.new_table_data("q_max", tables["q_max"])
for key in ["z", "q"]: for key in ["z", "q"]:
for func in ["min", "mean", "max"]: for func in ["min", "mean", "max"]:
name = f"res_{key}_{func}" name = f"{key}_{func}"
table[name] = results.new_table_data(name, tables[name])
name = f"res_{name}"
table[name] = results.new_table_data( table[name] = results.new_table_data(
name, name,
np.array( np.array(
@ -555,10 +550,12 @@ class SolverLogEnsWindow(SolverLogWindow):
) )
) )
for nb, data in tables["traces"]: # for nb, data in tables["traces"]:
name = f"{nb}_" # name = f"{nb}_"
table[name + "z"] = results.new_table_data(name + "z", data["Z"]) # table[name + "z"] = results.new_table_data(name + "z",
table[name + "q"] = results.new_table_data(name + "q", data["Q"]) # data["Z"])
# table[name + "q"] = results.new_table_data(name + "q",
# data["Q"])
table["samples"] = results.new_table_data( table["samples"] = results.new_table_data(
"samples", np.array(self._run_samples) "samples", np.array(self._run_samples)