Skip to content

Commit

Permalink
chore: update comments and improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraney committed Aug 15, 2024
1 parent bcc4252 commit 1f9770f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions python/ngen_cal/src/ngen/cal/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ def __init__(self, model: Model, workdir: 'Path', log: bool=False, restart: bool
self._workdir = workdir
self._job = None
assert not isinstance(model.model, NoModel), "invariant"
# NOTE: if support for new models is added, this will need to be modified
model_inner = model.model.unwrap()
# NOTE: if support for new models is added, support for other model
# type variants will be required
ngen_model = model.model.unwrap()
self._model = model
if restart:
# find prior ngen workdirs
Expand All @@ -76,14 +77,14 @@ def __init__(self, model: Model, workdir: 'Path', log: bool=False, restart: bool
# 0 correctly since not all basin params can be loaded.
# There are probably some similar issues with explicit and independent, since they have
# similar data semantics
workdirs = list(Path.glob(workdir, model_inner.type+"_*_worker"))
workdirs = list(Path.glob(workdir, ngen_model.type+"_*_worker"))
if len(workdirs) > 1:
print("More than one existing workdir, cannot restart")
elif len(workdirs) == 1:
self._job = JobMeta(model_inner.type, workdir, workdirs[0], log=log)
self._job = JobMeta(ngen_model.type, workdir, workdirs[0], log=log)

if self._job is None:
self._job = JobMeta(model_inner.type, workdir, log=log)
self._job = JobMeta(ngen_model.type, workdir, log=log)
self._model.model.resolve_paths(self.job.workdir)

self._params = parameters
Expand Down

0 comments on commit 1f9770f

Please sign in to comment.