Skip to content

Commit

Permalink
HAS_DATA -> RESPONSES_LOADED
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Nov 25, 2024
1 parent 22513bf commit 9ae400c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/ert/storage/local_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def get_realization_mask_with_parameters(self) -> npt.NDArray[np.bool_]:
bool(
{
RealizationStorageState.PARAMETERS_LOADED,
RealizationStorageState.HAS_DATA,
RealizationStorageState.RESPONSES_LOADED,
}.intersection(state)
)
for state in self.get_ensemble_state()
Expand All @@ -252,7 +252,7 @@ def get_realization_mask_with_responses(

return np.array(
[
RealizationStorageState.HAS_DATA in state
RealizationStorageState.RESPONSES_LOADED in state
for state in self.get_ensemble_state()
]
)
Expand Down Expand Up @@ -512,7 +512,7 @@ def _find_state(realization: int) -> Set[RealizationStorageState]:
assert failure
_state.add(failure.type)
if _responses_exist_for_realization(realization):
_state.add(RealizationStorageState.HAS_DATA)
_state.add(RealizationStorageState.RESPONSES_LOADED)
if _parameters_exist_for_realization(realization):
_state.add(RealizationStorageState.PARAMETERS_LOADED)

Expand Down Expand Up @@ -906,7 +906,7 @@ def get_response_state(
) -> Dict[str, RealizationStorageState]:
path = self._realization_dir(realization)
return {
e: RealizationStorageState.HAS_DATA
e: RealizationStorageState.RESPONSES_LOADED
if (path / f"{e}.parquet").exists()
else RealizationStorageState.UNDEFINED
for e in self.experiment.response_configuration
Expand Down
2 changes: 1 addition & 1 deletion src/ert/storage/realization_storage_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
class RealizationStorageState(Enum):
UNDEFINED = 1
PARAMETERS_LOADED = 2
HAS_DATA = 4
RESPONSES_LOADED = 4
LOAD_FAILURE = 8
PARENT_FAILURE = 16
7 changes: 5 additions & 2 deletions tests/ert/unit_tests/storage/test_local_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ def test_ensemble_no_parameters(storage):
name="prior",
)
assert all(
RealizationStorageState.HAS_DATA in s for s in ensemble.get_ensemble_state()
RealizationStorageState.RESPONSES_LOADED in s
for s in ensemble.get_ensemble_state()
)


Expand Down Expand Up @@ -1005,7 +1006,9 @@ def create_ensemble_from_prior(self, prior: Ensemble):
# If expecting no responses, i.e., it has empty .keys in all response
# configs, it will be a HAS_DATA even if no responses were ever saved
if not is_expecting_responses:
assert RealizationStorageState.HAS_DATA in edited_posterior_state
assert (
RealizationStorageState.RESPONSES_LOADED in edited_posterior_state
)
else:
assert self.iens_to_edit not in prior.failure_messages
assert RealizationStorageState.UNDEFINED in edited_posterior_state
Expand Down

0 comments on commit 9ae400c

Please sign in to comment.