Add a check for missing taxonomies in the scenario_damage calculator

Bug #1122817 reported by Michele Simionato
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Committed
Medium
Michele Simionato

Bug Description

If the fragility_model file contains less taxonomies than the ones in the exposure model, an error should be raised at the beginning, even before the computation starts (Vitor's specs).

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

I would like to point out a potential issue here. Consider a large exposure coming from ged4gem with thosands of taxonomies; the spec says that the calculation cannot even start even if a single taxonomy is left over from the fragility model. I would have espected something different, like performing the computation for the taxonomies in the fragility model and printing a warning if there are taxonomies in the exposure model not covered in the fragility model.

Revision history for this message
Vitor Silva (vitor-silva) wrote :

Michele both approaches seem reasonable to me, I would just like to provide some additional insight. GED4GEM might have indeed thousands of taxonomies, but for a given region (say even all Italy) it shall not have more than 200 taxonomies. For the purposes of this calculator (which considers a single earthquake rupture), the calculations are even more constrained to a given region (say 300km x 600 km), so even less taxonomies (and also assets) are expected.

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

Ok Vitor. I agree that by default the calculator should raise an error if there is a missing taxonomy in the fragility_model.
If in the future we wanted to support running a calculation even if not all taxonomies all covered,we could add an additional parameter in the job.ini file, for instance something like

taxonomies_from_fragility_model = True

If the parameter is missing or False, the calculator raises an error if the fragility model is missing some taxonomy.
If the parameter is set to True, the calculator only consider the taxonomies in the fragility model and write a warning
such as

Warning:The following taxonomies are present in the exposure_model, but missing in the fragility model, so they are being ignored:[...]

if there are taxonomies not covered in the fragility model. I would leave this feature for a future sprint, it is anyway easy to implement and it could be done even now if we want.

Changed in openquake:
assignee: nobody → Michele Simionato (michele-simionato)
importance: Undecided → Medium
status: New → In Progress
milestone: none → 0.9.2
Revision history for this message
matley (matley) wrote :

I guess that this problem still holds for vulnerability-based calculators.... So instead of having another parameters, why just not add a "taxonomy_from_model" argument, that can be used also by other calculators?

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

Makes sense.

Changed in openquake:
status: In Progress → Fix Committed
Revision history for this message
Lars Butler (lars-butler) wrote :

Please add a link to the pull request(s) before updating status to "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.