Skip to content

Commit

Permalink
Use iens = 0 to avoid error with ensemble_size=1
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Oct 2, 2024
1 parent 321767c commit 37ad8b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/ert/unit_tests/storage/test_local_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def write_error_in_save_field(self, model_ensemble: Ensemble, field_data):
storage_ensemble = self.storage.get_ensemble(model_ensemble.uuid)
parameters = model_ensemble.parameter_values.values()
fields = [p for p in parameters if isinstance(p, Field)]
iens = 1
iens = 0
assume(not storage_ensemble.realizations_initialized([iens]))
for f in fields:
with patch(
Expand All @@ -709,7 +709,7 @@ def write_error_in_save_field(self, model_ensemble: Ensemble, field_data):
def get_parameters(self, model_ensemble: Ensemble):
storage_ensemble = self.storage.get_ensemble(model_ensemble.uuid)
parameter_names = model_ensemble.parameter_values.keys()
iens = 1
iens = 0

for f in parameter_names:
parameter_data = storage_ensemble.load_parameters(f, iens)
Expand Down Expand Up @@ -748,7 +748,7 @@ def save_summary(self, model_ensemble: Ensemble, summary_data):
smspec, unsmry = summary_data
smspec.to_file(self.tmpdir + f"/{summary.input_files[0]}.SMSPEC")
unsmry.to_file(self.tmpdir + f"/{summary.input_files[0]}.UNSMRY")
iens = 1
iens = 0

try:
ds = summary.read_from_file(self.tmpdir, iens)
Expand All @@ -763,7 +763,7 @@ def save_summary(self, model_ensemble: Ensemble, summary_data):
def get_responses(self, model_ensemble: Ensemble):
storage_ensemble = self.storage.get_ensemble(model_ensemble.uuid)
names = model_ensemble.response_values.keys()
iens = 1
iens = 0

for n in names:
data = storage_ensemble.load_responses(n, (iens,))
Expand Down Expand Up @@ -820,7 +820,7 @@ def create_ensemble_from_prior(self, prior: Ensemble):
model_experiment = self.model[experiment_id]
model_experiment.ensembles[ensemble.id] = model_ensemble
state = [RealizationStorageState.PARENT_FAILURE] * size
iens = 1
iens = 0
if (
list(prior.response_values.keys())
== [r.name for r in model_experiment.responses]
Expand Down

0 comments on commit 37ad8b1

Please sign in to comment.