Skip to content

Commit

Permalink
Fix runpath check for ensemble experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
frode-aarstad committed Sep 22, 2023
1 parent 526c565 commit 37ea8e9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ert/run_models/ensemble_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import asyncio
import concurrent
import logging
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict
from uuid import UUID

Expand Down Expand Up @@ -169,3 +170,13 @@ def run_experiment(
@classmethod
def name(cls) -> str:
return "Ensemble experiment"

def check_if_runpath_exists(self) -> bool:
iteration = self._simulation_arguments.get("iter_num", 0)
active_mask = self._simulation_arguments.get("active_realizations", [])
active_realizations = [i for i in range(len(active_mask)) if active_mask[i]]
run_paths = self.facade.get_run_paths(active_realizations, iteration)
for run_path in run_paths:

Check warning on line 179 in src/ert/run_models/ensemble_experiment.py

View workflow job for this annotation

GitHub Actions / annotate-python-linting

Use 'return any(Path(run_path).exists() for run_path in run_paths)'
if Path(run_path).exists():
return True
return False

0 comments on commit 37ea8e9

Please sign in to comment.