Ensemble: Made it compatible with other solver than mage8.

scenario-dev-pa
Pierre-Antoine 2026-08-27 09:44:03 +02:00
parent ae006f52f4
commit 476bcc9c55
1 changed files with 21 additions and 4 deletions

View File

@ -526,10 +526,17 @@ class SolverLogEnsWindow(SolverLogWindow):
self._process = self.new_process(self._parent) self._process = self.new_process(self._parent)
self._log(f" *** Run #{self._last_run}", color="blue") self._log(f" *** Run #{self._last_run}", color="blue")
if self._solver._type in ["mage8"]:
self._solver.export_ensemble_variation( self._solver.export_ensemble_variation(
self._study, self._workdir, qlog=self._output, self._study, self._workdir, qlog=self._output,
samples=self._samples, samples=self._samples,
) )
else:
self.ensemble_variation_strickler()
self._solver.export(
self._study, self._workdir, qlog=self._output
)
self._solver.run( self._solver.run(
self._study, self._study,
@ -539,6 +546,16 @@ class SolverLogEnsWindow(SolverLogWindow):
self._last_run += 1 self._last_run += 1
self._progress_bar.setValue(self._last_run - 1) self._progress_bar.setValue(self._last_run - 1)
def ensemble_variation_strickler(self):
for ens in self._samples:
if ens.target_data is None:
continue
if ens.data_type == "strickler_minor":
ens.target_data.minor = next(self._samples[ens])
elif ens.data_type == "strickler_medium":
ens.target_data.medium = next(self._samples[ens])
def run(self): def run(self):
self._log(f" *** Run solver {self._solver.name}", color="blue") self._log(f" *** Run solver {self._solver.name}", color="blue")
self.next() self.next()