Validate that time_event match the current exposure
Bug #1182526 reported by
matley
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake Engine |
Fix Released
|
Critical
|
matley |
Bug Description
In the scenario calculator we need to validate the time_event parameter value got from job.ini.
Given a vulnerability model for the occupancy and an exposure we need to check that every asset has a proper occupancy entry for the given time_event.
Changed in oq-engine: | |
importance: | Undecided → Critical |
status: | New → Confirmed |
Changed in oq-engine: | |
milestone: | 1.0.0 → 1.0.1 |
Changed in oq-engine: | |
status: | In Progress → Fix Committed |
Changed in oq-engine: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
A simple way to elicit the problem is to change the exposure file qa_tests/ risk/scenario/ occupants/ exposure_ model.xml ,by modifying the period of an asset, for instance from day->Day. Then the whole tests break with a baffling error message:
ERROR: test (qa_tests. risk.scenario. occupants. test.ScenarioOc cupantsQATestCa se1) ------- ------- ------- ------- ------- ------- ------- ------- ------- michele/ oq-engine/ qa_tests/ risk/scenario/ occupants/ test.py" , line 27, in test _run_test( ) michele/ oq-engine/ qa_tests/ risk/__ init__. py", line 88, in _run_test hazard_ id(self. get_hazard_ job())) michele/ oq-engine/ qa_tests/ risk/__ init__. py", line 165, in run_risk calculation_ id=hazard_ id) michele/ oq-engine/ tests/utils/ helpers. py", line 192, in run_risk_job _do_run_ calc(job, exports, calc, 'risk') michele/ oq-engine/ openquake/ engine/ engine. py", line 576, in _do_run_calc michele/ oq-engine/ openquake/ engine/ calculators/ base.py" , line 229, in execute next(self. core_calc_ task, task_gen.next()) michele/ oq-engine/ openquake/ engine/ calculators/ risk/base. py", line 150, in task_arg_gen loss_types( self.risk_ models) ] michele/ oq-engine/ openquake/ engine/ calculators/ risk/scenario/ core.py" , line 180, in calculation_unit
-------
Traceback (most recent call last):
File "/home/
self.
File "/home/
self.
File "/home/
cfg, hazard_
File "/home/
completed_job = engine.
File "/home/
calc.execute()
File "/home/
queue_
File "/home/
for loss_type in models.
File "/home/
taxonomy = assets[0].taxonomy
IndexError: list index out of range