nismod/smif

Improve reporting when model subprocess fails

Opened this issue · 0 comments

Example run:

$ smif run energy_supply_minimal
smif\data_layer\file\file_metadata_store.py:135: FionaDeprecationWarning: Use fiona.Env() instead.
  with fiona.drivers():
pandas\core\frame.py:3697: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  errors=errors)
Traceback (most recent call last):
  File "smif\controller\scheduler.py", line 178, in add
    self._run(job_graph, job_graph_id)
  File "smif\controller\scheduler.py", line 249, in _run
    model.simulate(data_handle)
  File "models\energy_supply\energy_supply.py", line 31, in simulate
    self.run_the_model()
  File "models\energy_supply\energy_supply.py", line 209, in run_the_model
    self.logger.debug(check_output([model_path]))
  File "lib\subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "lib\subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['models\\energy_supply\\..\\..\\install\\energy_supply\\Energy_Supply_Master.exe']' returned non-zero exit status 3221225595.
CalledProcessError: Command '['models\\energy_supply\\..\\..\\install\\energy_supply\\Energy_Supply_Master.exe']' returned non-zero exit status 3221225595.
  • should be clearer that this is a model-running failure
  • could avoid or suppress warnings (these add noise, make things less clear)
  • could add a message to suggest running with -vv for debugging output
  • could do more to capture/report stderr/out from subprocess if possible and helpful