Skip to content

Commit

Permalink
Merge pull request #370 from jo-basevi/369-set-counter-bug-fix
Browse files Browse the repository at this point in the history
Fix bug in set_counter
  • Loading branch information
jo-basevi committed Oct 4, 2023
2 parents fc83ec9 + dfe86a4 commit c1db6dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions payu/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def __init__(self, lab, reproduce=False, force=False):
self.set_expt_pathnames()
self.set_counters()


for model in self.models:
model.set_input_paths()

Expand Down Expand Up @@ -175,13 +176,13 @@ def set_counters(self):
if self.counter is None:
# Check for restart index
max_restart_index = self.max_output_index(output_type="restart")
if max_restart_index:
if max_restart_index is not None:
self.counter = 1 + max_restart_index
else:
# Now look for output directories,
# as repeat runs do not generate restart files.
max_output_index = self.max_output_index()
if max_output_index:
if max_output_index is not None:
self.counter = 1 + max_output_index
else:
self.counter = 0
Expand Down

0 comments on commit c1db6dc

Please sign in to comment.