Skip to content

Commit

Permalink
Inline case_name variable (#9594)
Browse files Browse the repository at this point in the history
Remove casename
  • Loading branch information
StephanDeHoop authored Dec 19, 2024
1 parent 0906db9 commit bc8be8f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/everest/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,11 @@ def get_internalized_keys(
internal_keys: set = set()
with open_storage(storage_path, "r") as storage:
for batch_id in batch_ids:
case_name = f"batch_{batch_id}"
experiments = [*storage.experiments]
assert len(experiments) == 1
experiment = experiments[0]

ensemble = experiment.get_ensemble_by_name(case_name)
ensemble = experiment.get_ensemble_by_name(f"batch_{batch_id}")
if not internal_keys:
internal_keys = set(
ensemble.experiment.response_type_to_response_keys["summary"]
Expand Down Expand Up @@ -316,14 +315,13 @@ def load_simulation_data(
with open_storage(ens_path, "r") as storage:
# pylint: disable=unnecessary-lambda-assignment
def load_batch_by_id():
case_name = f"batch_{batch}"
experiments = [*storage.experiments]

# Always assume 1 experiment per simulation/enspath, never multiple
assert len(experiments) == 1
experiment = experiments[0]

ensemble = experiment.get_ensemble_by_name(case_name)
ensemble = experiment.get_ensemble_by_name(f"batch_{batch}")
realizations = ensemble.get_realization_list_with_responses()
try:
df_pl = ensemble.load_responses("summary", tuple(realizations))
Expand Down

0 comments on commit bc8be8f

Please sign in to comment.