Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions src/ert/shared/models/base_run_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,16 @@ def _create_mask_from_failed_realizations(self) -> List[bool]:
Creates a list of bools representing the failed realizations,
i.e., a realization that has failed is assigned a True value.
"""
return [
initial and not completed
for initial, completed in zip(
self._initial_realizations_mask, self._completed_realizations_mask
)
]
if self._completed_realizations_mask:
return [
initial and not completed
for initial, completed in zip(
self._initial_realizations_mask, self._completed_realizations_mask
)
]
else:
# If all realisations fail
return [True] * len(self._initial_realizations_mask)

def _count_successful_realizations(self) -> int:
"""
Expand Down
1 change: 1 addition & 0 deletions tests/unit_tests/models/test_base_run_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def test_active_realizations(initials, expected):
([False, False], [False, False], False, [False, False]),
([False, False], [True, True], False, [False, False]),
([True, True], [False, True], True, [True, False]),
([False, False], [], True, [True, True]),
],
)
def test_failed_realizations(initials, completed, any_failed, failures):
Expand Down