"assert dmg0 >= 0, dmg0" fails with -1.76E-6

10 views
Skip to first unread message

Cecilia I. Nievas

unread,
Sep 10, 2026, 3:24:50 AM (10 days ago) Sep 10
to openqua...@googlegroups.com

Dear OpenQuake developers,

I am running a scenario damage calculation, but it crashes with:

  File "/home/user/Documents/openquake_repos/oq_3_26_0/oq-engine/openquake/calculators/post_risk.py", line 360, in compute_aggrisk
    assert dmg0 >= 0, dmg0
AssertionError: -1.7623901360508398e-06

When looking at what is going on in the calculation around line 360 I see:

(Pdb) ndamaged
np.float32(13800.002)
(Pdb) aggnumber[agg_id]
np.float32(13.8)
(Pdb) ne
np.int64(1000)
(Pdb) L
1
(Pdb) dmg0
np.float64(-1.7623901360508398e-06)

Should there be a tolerance for this comparison?

Please let me know if you need further details.

Thanks in advance!

Best regards,

Cecilia

Reply all
Reply to author
Forward
0 new messages