Non-informative error message when an intervention in pre-spec planning is missing from intervention file
willu47 opened this issue · 0 comments
willu47 commented
When an intervention is specified in a pre-specified planning strategy, but missing from an intervention listing, a KeyError is raised, should be a SmifDataNotFound error (or better).
Traceback (most recent call last):
File "d:\lahiru\envs\nismod\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\lahiru\envs\nismod\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Lahiru\envs\nismod\Scripts\smif.exe\__main__.py", line 9, in <module>
File "d:\lahiru\envs\nismod\lib\site-packages\smif\cli\__init__.py", line 345, in main
args.func(args)
File "d:\lahiru\envs\nismod\lib\site-packages\smif\cli\__init__.py", line 129, in run_model_runs
execute_model_run(model_run_ids, store, args.warm)
File "d:\lahiru\envs\nismod\lib\site-packages\smif\controller\execute.py", line 32, in execute_model_run
modelrun.run(store)
File "d:\lahiru\envs\nismod\lib\site-packages\smif\controller\modelrun.py", line 137, in run
modelrunner.solve_model(self, store)
File "d:\lahiru\envs\nismod\lib\site-packages\smif\controller\modelrun.py", line 180, in solve_model
for bundle in decision_manager.decision_loop():
File "d:\lahiru\envs\nismod\lib\site-packages\smif\decision\decision.py", line 191, in decision_loop
self._get_and_save_bundle_decisions(bundle)
File "d:\lahiru\envs\nismod\lib\site-packages\smif\decision\decision.py", line 210, in _get_and_save_bundle_decisions
self.get_and_save_decisions(iteration, timestep)
File "d:\lahiru\envs\nismod\lib\site-packages\smif\decision\decision.py", line 240, in get_and_save_decisions
decisions.extend(self.pre_spec_planning.get_decision(results_handle))
File "d:\lahiru\envs\nismod\lib\site-packages\smif\decision\decision.py", line 402, in get_decision
data = self._register[intervention['name']]
KeyError: '20_Didcot_GT_retire'