Skip to content

Commit

Permalink
Check combined ds in _has_response
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Oct 22, 2024
1 parent 6858651 commit db9cebc
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/ert/storage/local_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,19 +301,27 @@ def _responses_exist_for_realization(
return True
path = self._realization_dir(realization)

def _has_response(_key: str) -> bool:
if _key in self.experiment.response_key_to_response_type:
_response_type = self.experiment.response_key_to_response_type[_key]
return (path / f"{_response_type}.parquet").exists()

return (path / f"{_key}.parquet").exists()
# Note: potential performance bottleneck,
# should be improved greatly by having statemap.
# Should also be faster due to lru cache on load_responses
def _has_response(_response_type: str) -> bool:
if (path / f"{_response_type}.parquet").exists():
return True

if (self.mount_point / f"{_response_type}.parquet").exists():
return (
realization
in self.load_responses(
_response_type, tuple(range(self.ensemble_size))
)["realization"]
)

if key:
return _has_response(key)

return all(
_has_response(response)
for response in self.experiment.response_configuration
_has_response(response_type)
for response_type in self.experiment.response_configuration
)

def is_initalized(self) -> List[int]:
Expand Down

0 comments on commit db9cebc

Please sign in to comment.