Skip to content

Commit

Permalink
style: code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraney committed Aug 21, 2024
1 parent 58ba1f3 commit cee918d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions python/ngen_cal/src/ngen/cal/ngen_hooks/ngen_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,21 @@ class NgenSaveOutput:
terminal_pattern = "tnx-*.csv"
coastal_pattern = "cnx-*.csv"
routing_output = "flowveldepth_Ngen.csv"

@hookimpl(trylast=True)
def ngen_cal_model_iteration_finish(self, iteration: int, info: JobMeta) -> None:
"""
After each iteration, copy the old outputs for possible future
evaluation and inspection.
After each iteration, copy the old outputs for possible future
evaluation and inspection.
"""
path = info.workdir
out_dir = path/f"output_{iteration}"
out_dir = path / f"output_{iteration}"
Path.mkdir(out_dir)
globs = []
globs.append( path.glob(self.runoff_pattern) )
globs.append( path.glob(self.lateral_pattern) )
globs.append( path.glob(self.terminal_pattern) )
globs.append( path.glob(self.coastal_pattern) )
globs.append(path.glob(self.runoff_pattern))
globs.append(path.glob(self.lateral_pattern))
globs.append(path.glob(self.terminal_pattern))
globs.append(path.glob(self.coastal_pattern))
for g in globs:
for f in g:
f.rename(out_dir / f.name)
Expand Down

0 comments on commit cee918d

Please sign in to comment.