gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
377 stars 273 forks source link

Error at the end of run-demos.sh #2897

Closed ptormene closed 7 years ago

ptormene commented 7 years ago

All demos seem to finish correctly, but at the end I see the following error:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/paolo/projects/oq-engine/openquake/commands/__main__.py", line 52, in <module>
    oq()
  File "/home/paolo/projects/oq-engine/openquake/commands/__main__.py", line 49, in oq
    parser.callfunc()
  File "/home/paolo/projects/oq-engine/openquake/baselib/sap.py", line 186, in callfunc
    return self.func(**vars(namespace))
  File "/home/paolo/projects/oq-engine/openquake/baselib/sap.py", line 245, in main
    return func(**kw)
  File "/home/paolo/projects/oq-engine/openquake/commands/engine.py", line 178, in engine
    exports, hazard_calculation_id=hc_id)
  File "/home/paolo/projects/oq-engine/openquake/commands/engine.py", line 63, in run_job
    job_ini, getpass.getuser(), hazard_calculation_id)
  File "/home/paolo/projects/oq-engine/openquake/engine/engine.py", line 165, in job_from_file
    oq = readinput.get_oqparam(cfg_file)
  File "/home/paolo/projects/oq-engine/openquake/commonlib/readinput.py", line 171, in get_oqparam
    oqparam = OqParam(**job_ini)
  File "/home/paolo/projects/oq-engine/openquake/commonlib/oqvalidation.py", line 155, in __init__
    super(OqParam, self).__init__(**names_vals)
  File "/home/paolo/projects/oq-engine/openquake/hazardlib/valid.py", line 1138, in __init__
    % (exc, convert.__name__, name, val))
ValueError: Got 'my_scenario', expected scenario_risk|psha|classical|disaggregation|classical_risk|classical_bcr|event_based_rupture|event_based|event_based_risk|scenario|ucerf_rupture|ucerf_hazard|ucerf_risk|ucerf_psha|ucerf_classical|classical_damage|gmf_ebrisk|scenario_damage: could not convert to Choice('scenario_risk', 'psha', 'classical', 'disaggregation', 'classical_risk', 'classical_bcr', 'event_based_rupture', 'event_based', 'event_based_risk', 'scenario', 'ucerf_rupture', 'ucerf_hazard', 'ucerf_risk', 'ucerf_psha', 'ucerf_classical', 'classical_damage', 'gmf_ebrisk', 'scenario_damage'): calculation_mode=my_scenario
daniviga commented 7 years ago

I've been able to reproduce the error on my local setup.

micheles commented 7 years ago

I see the following::

$ grin my_scenario
./doc/sphinx/job.ini:
    3 : calculation_mode = my_scenario
./doc/sphinx/test.py:
   25 :     def test_my_scenario(self):
./doc/tutorials/my_calculators/scenario.py:
   25 : @base.calculators.add('my_scenario')

Looks like some outdated documentation. Does the error disappear if you remove those files?