The loss curves in the scenario calculator are reproducible only by accident
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake Engine |
Fix Released
|
High
|
Michele Simionato |
Bug Description
Currently the numbers produced by the risk scenario calculator are reproducible, but only because we are reading the ground motion fields in a fixed order. Even simple refactorings of the hazard getters will return the GMFs in a different order and produce different numbers, unless extra care is taken. The extra care consists in keeping the relative order of GMFs and epsilons consistent. The problem is exercised in the following test case in risklib.
class MeanLossTestCas
def test_mean_
vf = scientific.
'PGA', imls=[0.1, 0.2, 0.3, 0.5, 0.7],
epsilons = [0.98982371, 0.2776809, -0.44858935, 0.96196624,
imls = [0.280357, 0.443609, 0.241845, 0.506982, 0.459758,
mean = vf.apply_to([imls], [epsilons]
aaae(mean, 0.2318058254)
# if you don't reorder the epsilons, the mean loss depends by
# the order of the imls!
mean2 = vf.apply_
aaae(mean2, 0.238145174018)
# by reordering the epsilons the problem is solved
mean3 = vf.apply_
aaae(mean3, mean)
On the engine side, one must ensure that the epsilons are correctly associated to the GMFs.
Changed in oq-engine: | |
assignee: | nobody → Michele Simionato (michele-simionato) |
importance: | Undecided → High |
milestone: | none → 1.0.1 |
status: | New → In Progress |
summary: |
- The loss curves in the scenario calculator are reproducible by accident + The loss curves in the scenario calculator are reproducible only by + accident |
Changed in oq-engine: | |
status: | In Progress → Fix Committed |
Changed in oq-engine: | |
status: | Fix Committed → Fix Released |
https:/ /github. com/gem/ oq-risklib/ pull/75