Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use iens = 0 to avoid error with ensemble_size=1 #8817

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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