AssertionError when earthquake magnitude too small

15 views
Skip to first unread message

Cecilia I. Nievas

unread,
Mar 6, 2026, 10:10:24 AM (9 days ago) Mar 6
to openqua...@googlegroups.com

Dear OpenQuake developers,

As I mentioned in my email from some days ago, I am trying to upgrade the Real-Time Loss Tools (RTLTs) to OpenQuake v3.25.0 (current master, actually, to be able to use Michele's recent fix for the AvgSA validation). The RTLTs successively run OpenQuake's scenario damage calculator in a chain, and catch some OpenQuake exceptions and make decisions based on them if possible, so as to not stop the run. In particular, OpenQuake exceptions that indicate that no damage was caused because the rupture is too far away, the ground motions are too weak, etc, lead to the RTLTs continuing the run, as the outcome is "there is no further damage from this earthquake, everything stays the same, move on to the next one", without the need to crash. While working with OpenQuake v3.15 the RTLTs were catching the "No GMFs were generated, perhaps they were all below the minimum_intensity threshold" error here and testing it with the attached input files (in this test). When I run this test now with the current master of the engine, I get the following:

[2026-03-06 14:30:05 #309 INFO] Read 3 assets in 0.01s from real-time-loss-tools/tests/data/temp_integration_rla_no_GMFs/current/exposure_model_current.csv
Traceback (most recent call last):
  File "/home/cnievas/.pyenv/versions/PyVenv_3_12_0_OQ_3_25_0/bin/oq", line 6, in <module>
    sys.exit(oq())
             ^^^^
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/commands/__main__.py", line 44, in oq
    sap.run(commands, prog='oq')
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/baselib/sap.py", line 233, in run
    return _run(parser(obj, **parserkw), argv)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/baselib/sap.py", line 218, in _run
    return func(**dic)
           ^^^^^^^^^^^
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/commands/engine.py", line 176, in main
    run_jobs(jobs, nodes=nodes, sbatch=True,
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/engine/engine.py", line 410, in run_jobs
    _run(jobctxs, job_id, nodes, sbatch,
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/engine/engine.py", line 342, in _run
    run_calc(jobctx)
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/engine/engine.py", line 219, in run_calc
    calc.run(shutdown=True)
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/calculators/base.py", line 333, in run
    self.pre_execute()
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/calculators/event_based_risk.py", line 427, in pre_execute
    super().pre_execute()
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/calculators/base.py", line 728, in pre_execute
    calc.run(remove=False)
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/calculators/base.py", line 333, in run
    self.pre_execute()
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/calculators/base.py", line 739, in pre_execute
    self.read_inputs()
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/calculators/base.py", line 601, in read_inputs
    self._read_risk1()
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/calculators/base.py", line 988, in _read_risk1
    haz_sitecol = readinput.get_site_collection(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/commonlib/readinput.py", line 708, in get_site_collection
    mesh, exp = get_mesh_exp(oqparam, h5)
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/commonlib/readinput.py", line 428, in get_mesh_exp
    exposure = get_exposure(oqparam, h5)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/commonlib/readinput.py", line 1123, in get_exposure
    exposure = asset.Exposure.read_all(
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/risklib/asset.py", line 1099, in read_all
    exp.build_mesh(assets_df)
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/risklib/asset.py", line 1144, in build_mesh
    mesh = geo.Mesh(ll[:, 0], ll[:, 1])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cnievas/Documents/openquake_repos/oq_3_25_0_master_bug_fixed/oq-engine/openquake/hazardlib/geo/mesh.py", line 234, in __init__
    assert lons.size > 0
AssertionError

From what I am seeing, this happens because the test inputs a magnitude 0.1 earthquake (so as to get the "No GMFs were generated, perhaps they were all below the minimum_intensity threshold" error) and the filtering introduced by rupfilter = RuptureFilter(rup, dist) (in "get_exposure" of readinput.py) results in the exposure being empty when processed by "read_all" of openquake/risklib/asset.py.

In the attached files, you can find the job.ini under temp_integration_rla_no_GMFs/current/job.ini.

What I am wondering is if it would be possible for a more explicit error to be raised, instead of letting it crash with the AssertionError. Of course I do not know the big picture of all the ways in which the calculations can fail or not and all the errors that OpenQuake is already catching, so maybe this is not possible. But if it were to be possible, then it would be easier to make decisions based on that error. For example, for my particular case it would be useful that the error still explicitly mentions that the earthquake is too far away, or the ground motions are too weak, or the minimum intensity threshold was not reached, or similar, because all these tell me that, ultimately, this earthquake does not cause damage to any of the exposed assets, which is what I need to know, and then move on with the calculation. I feel that making such an assumption with a generic "AssertionError" would not be a good idea, because I suspect there might be so many different situations that may lead to such an error, including relevant problems in the input files.

In a more general sense, is there a way of forcing OpenQuake to carry out the calculation for the input files I am sending? The files correspond to a magnitude 0.1 earthquake (as the objective was to get the "No GMFs were generated, perhaps they were all below the minimum_intensity threshold" error). I know it sounds trivial, but in the context of induced seismicity it can be relevant (or at least useful for the user to be able to change a setting for this threshold not to apply).

Thanks in advance for taking the time to read this far!

Best regards,

Cecilia

temp_integration_rla_no_GMFs.zip

Michele Simionato

unread,
Mar 9, 2026, 6:13:41 AM (6 days ago) Mar 9
to OpenQuake Users
This is done in master: https://github.com/gem/oq-engine/pull/11288
Now the error message is

File "/home/michele/oq-engine/openquake/risklib/asset.py", line 1100, in read_all raise FilteredAway('No assets within %r' % rupfilter) openquake.hazardlib.calc.filters.FilteredAway: No assets within <RuptureFilter mag=0.1 dist=0>

Cecilia I. Nievas

unread,
Mar 9, 2026, 6:30:03 AM (6 days ago) Mar 9
to openqua...@googlegroups.com, Michele Simionato

Hi Michele,

This is great, thanks!

Best regards,

Cecilia

--
You received this message because you are subscribed to the Google Groups "OpenQuake Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openquake-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/openquake-users/82734da9-2c99-4343-b7cb-660d2fcd8664n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages