Skip to content

Commit

Permalink
Fix incorrect batch ensemble getter
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Nov 19, 2024
1 parent 2475f7f commit a1f6d31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/everest/api/everest_data_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,9 @@ def summary_values(self, batches=None, keys=None):
simulations = self.simulations
data_frames = []
storage = open_storage(self._config.storage_dir, "r")
experiment = next(storage.experiments)
for batch_id in batches:
case_name = f"batch_{batch_id}"
experiment = storage.get_experiment_by_name(f"experiment_{case_name}")
ensemble = experiment.get_ensemble_by_name(case_name)
ensemble = experiment.get_ensemble_by_name(f"batch_{batch_id}")
summary = ensemble.load_all_summary_data()
if not summary.empty:
columns = set(summary.columns)
Expand Down
5 changes: 2 additions & 3 deletions src/everest/bin/everload_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,10 @@ def reload_data(ever_config: EverestConfig, backup_path=None) -> None:
def _internalize_batch(
ensemble_path: str, run_path_format: str, batch_id, batch_data
) -> None:
case_name = "batch_{}".format(batch_id)
batch_size = batch_data.shape[0]
with open_storage(ensemble_path, "w") as storage:
experiment = storage.get_experiment_by_name(f"experiment_{case_name}")
ensemble = experiment.get_ensemble_by_name(case_name)
experiment = next(storage.experiments)
ensemble = experiment.get_ensemble_by_name(f"batch_{batch_id}")
active_realizations = list(range(batch_size))
LibresFacade.load_from_run_path(run_path_format, ensemble, active_realizations)

Expand Down

0 comments on commit a1f6d31

Please sign in to comment.