Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-informative error message when an intervention in pre-spec planning is missing from intervention file #365

Open
willu47 opened this issue Apr 26, 2019 · 0 comments

Comments

@willu47
Copy link
Member

willu47 commented Apr 26, 2019

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'
@willu47 willu47 added this to the Usability milestone Apr 26, 2019
@tomalrussell tomalrussell removed this from the Usability milestone Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants