Skip to content

Commit

Permalink
Check for OK file
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKallekleiv committed Sep 29, 2020
1 parent 98dbad1 commit fa89bbd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions webviz_subsurface/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ def subscribe(scratch_ensembles, config_folder, portable):
if not pathlib.Path(ensemble_path).is_absolute():
scratch_ensembles[ensemble_name] = str(config_folder / ensemble_path)

if not portable and not glob.glob(scratch_ensembles[ensemble_name]):
if not portable and not glob.glob(
str(pathlib.Path(scratch_ensembles[ensemble_name]) / "OK")
):
if not glob.glob(scratch_ensembles[ensemble_name]):
raise ValueError(
f"Ensemble {ensemble_name} is said to be located at {ensemble_path},"
" but that wildcard path does not give any matches."
)
raise ValueError(
f"Ensemble {ensemble_name} is said to be located at {ensemble_path},"
" but that wildcard path does not give any matches."
f"No realizations with a valid target file ('OK') found for ensemble "
f"{ensemble_name} located at {ensemble_path}. This can occur when running "
"ERT if no simulations are finished, or all simulations has failed."
)

return scratch_ensembles

0 comments on commit fa89bbd

Please sign in to comment.