Open micheles opened 2 years ago
For a generic and flexible consequence module, we would need to handle the following things cleanly and consistently:
loss
, losses
, collapsed
, injured
, fatalities
, homeless
) and these are hardcoded in risklib/scientific.py. In demos/risk/ScenarioDamage/consequences.csv, the consequence being calculated is losses
.taxonomy
.
This link is also currently explicitly declared in the job file demos/risk/ScenarioDamage/job_risk.ini
[consequence]
consequence_file = {'taxonomy': 'consequences.csv'}
loss_type
field in the consequences CSV file. In demos/risk/ScenarioDamage/consequences.csv the user indicates that the structural damage state probabilities are to be used.elif consequence == 'losses':
return dmgdist @ coeffs * asset['value-' + loss_type]
elif consequence == 'collapsed':
return dmgdist @ coeffs * asset['value-number']
elif consequence == 'injured':
return dmgdist @ coeffs * asset['occupants_night']
elif consequence == 'fatalities':
return dmgdist @ coeffs * asset['occupants_night']
elif consequence == 'homeless':
return dmgdist @ coeffs * asset['occupants_avg']
aggregate_by = ..
the engine must perform the usual aggregation by tag(s) for each consequence, similar to what's done by the scenario risk and event based risk calculators for losses and the scenario damage and event based damage calculators for damage results.Please note that the homeless
calculations should be using residents
(and not occupants_avg
or occupants_night
). More background here: https://github.com/gem/oq-engine/issues/8788
The script in oq-risk-tests by @raoanirudh does not work with engine 3.12+ for several reasons (changed sap, changed the datastore, moved modules around). A good idea would be to integrate it in the engine since now the event based damage calculator is a lot more powerful that it was in the past. This is a lot of work.