Skip to content

Commit

Permalink
Dont use get_ensemble_by_name from LocalStorage
Browse files Browse the repository at this point in the history
erts api has been updated such that get_ensemble_by_name
is only available via LocalExperiment.
  • Loading branch information
dafeda committed Sep 5, 2024
1 parent 54654a1 commit d21d517
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/workflows/ahm_analysis/test_ahm_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def test_make_update_log_df(snake_oil_facade, snapshot):
snapshots are correct, they are just documenting the current behavior.
"""
with open_storage(snake_oil_facade.enspath, "w") as storage:
prior_ens = storage.get_ensemble_by_name("default")
experiment = storage.get_experiment_by_name("default_experiment_name")
prior_ens = experiment.get_ensemble_by_name("default")
posterior_ens = storage.create_ensemble(
prior_ens.experiment_id,
ensemble_size=prior_ens.ensemble_size,
Expand Down
6 changes: 4 additions & 2 deletions tests/workflows/ahm_analysis/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
def test_ahmanalysis_run(snake_oil_facade):
"""test data_set with only scalar parameters"""
with open_storage(snake_oil_facade.enspath, "w") as storage:
experiment = storage.get_experiment_by_name("default_experiment_name")
snake_oil_facade.run_ertscript(
ahmanalysis.AhmAnalysisJob,
storage,
storage.get_ensemble_by_name("default"),
experiment.get_ensemble_by_name("default"),
)

# assert that this returns/generates a KS csv file
Expand Down Expand Up @@ -70,10 +71,11 @@ def test_ahmanalysis_run_deactivated_obs(snake_oil_facade, snapshot, caplog):
with open_storage(snake_oil_facade.enspath, "w") as storage, caplog.at_level(
logging.WARNING
):
experiment = storage.get_experiment_by_name("default_experiment_name")
snake_oil_facade.run_ertscript(
ahmanalysis.AhmAnalysisJob,
storage,
storage.get_ensemble_by_name("default"),
experiment.get_ensemble_by_name("default"),
)
assert "Analysis failed for" in caplog.text

Expand Down

0 comments on commit d21d517

Please sign in to comment.