Validate that time_event match the current exposure

Bug #1182526 reported by matley
6
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.

matley (matley)
Changed in oq-engine:
importance: Undecided → Critical
status: New → Confirmed
matley (matley)
Changed in oq-engine:
milestone: 1.0.0 → 1.0.1
Revision history for this message
Michele Simionato (michele-simionato) wrote :

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.ScenarioOccupantsQATestCase1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/michele/oq-engine/qa_tests/risk/scenario/occupants/test.py", line 27, in test
    self._run_test()
  File "/home/michele/oq-engine/qa_tests/risk/__init__.py", line 88, in _run_test
    self.hazard_id(self.get_hazard_job()))
  File "/home/michele/oq-engine/qa_tests/risk/__init__.py", line 165, in run_risk
    cfg, hazard_calculation_id=hazard_id)
  File "/home/michele/oq-engine/tests/utils/helpers.py", line 192, in run_risk_job
    completed_job = engine._do_run_calc(job, exports, calc, 'risk')
  File "/home/michele/oq-engine/openquake/engine/engine.py", line 576, in _do_run_calc
    calc.execute()
  File "/home/michele/oq-engine/openquake/engine/calculators/base.py", line 229, in execute
    queue_next(self.core_calc_task, task_gen.next())
  File "/home/michele/oq-engine/openquake/engine/calculators/risk/base.py", line 150, in task_arg_gen
    for loss_type in models.loss_types(self.risk_models)]
  File "/home/michele/oq-engine/openquake/engine/calculators/risk/scenario/core.py", line 180, in calculation_unit
    taxonomy = assets[0].taxonomy
IndexError: list index out of range

Revision history for this message
Michele Simionato (michele-simionato) wrote :

The error is due to the fact that the tests uses a single asset, but with more assets the ones with the wrong period are lost, the engine gets confused and actually it gets stuck in the loop while completed < expected! A total disaster.

Revision history for this message
matley (matley) wrote :
Changed in oq-engine:
status: Confirmed → In Progress
matley (matley)
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.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.