Skip to content

Commit

Permalink
Implement property iteration on BRM!
Browse files Browse the repository at this point in the history
  • Loading branch information
Blunde1 committed Dec 1, 2023
1 parent 7918ce3 commit 71b4aaa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ert/run_models/iterated_ensemble_smoother.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ def __init__(
# It is initialized later, but kept track of here
self.sies_smoother = None

@property
def iteration(self) -> int:
"""Returns the SIES iteration number, starting at 1."""
if self.sies_smoother is None:
return 1
else:
return self.sies_smoother.iteration

def analyzeStep(
self,
prior_storage: EnsembleAccessor,
Expand Down Expand Up @@ -182,8 +190,7 @@ def run_experiment(
current_iter - 1,
)

assert self.sies_smoother is not None, "smoother must be initialized"
analysis_success = current_iter < self.sies_smoother.iteration
analysis_success = current_iter < self.iteration
if analysis_success:
update_success = True
break
Expand Down

0 comments on commit 71b4aaa

Please sign in to comment.