From 2b9bb2a0ac226a6227f42e7bf30784a48f51cd55 Mon Sep 17 00:00:00 2001 From: Austin Raney Date: Wed, 31 Jul 2024 15:29:31 -0400 Subject: [PATCH] fix: remapping cat -> wb. regression part of #141 --- python/ngen_cal/src/ngen/cal/calibration_set.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/ngen_cal/src/ngen/cal/calibration_set.py b/python/ngen_cal/src/ngen/cal/calibration_set.py index f2a8a76e..c750a88f 100644 --- a/python/ngen_cal/src/ngen/cal/calibration_set.py +++ b/python/ngen_cal/src/ngen/cal/calibration_set.py @@ -62,7 +62,10 @@ def output(self) -> 'DataFrame': """ # TODO should contributing_catchments be singular??? assuming it is for now... # Call output hooks, take first non-none result provided from hooks (called in LIFO order of registration) - df = self._hooks.ngen_cal_model_output(id=self._eval_nexus.contributing_catchments[0].replace('cat', 'wb')) + cat_id = self._eval_nexus.contributing_catchments[0].id + assert cat_id.startswith("cat"), f"expected catchment id to start with 'cat': {cat_id}" + cat_id = cat_id.replace("cat", "wb") + df = self._hooks.ngen_cal_model_output(id=cat_id) if df is None: # list of results is empty print("No suitable output found from output hooks...") @@ -144,4 +147,4 @@ def restart(self): except FileNotFoundError: return 0 #Reload the evaluation information - return Evaluatable.restart(self) \ No newline at end of file + return Evaluatable.restart(self)