gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
377 stars 273 forks source link

Store both filtered and complete site collections (when it makes sense) #8950

Closed micheles closed 11 months ago

micheles commented 1 year ago

Right now storing a filtered site collection cause an issue, because when reading it, it becomes complete :-(

micheles commented 12 months ago

This is serious: the lack of the complete site collection breaks the gmf_data exporter. Attached is a breaking example: job.zip

$ oq export gmf_data
Traceback (most recent call last):
  File "/home/michele/openquake/bin/oq", line 33, in <module>
    sys.exit(load_entry_point('openquake.engine', 'console_scripts', 'oq')())
  File "/home/michele/oq-engine/openquake/commands/__main__.py", line 48, in oq
    sap.run(commands, prog='oq')
  File "/home/michele/oq-engine/openquake/baselib/sap.py", line 212, in run
    return _run(parser(funcdict, **parserkw), argv)
  File "/home/michele/oq-engine/openquake/baselib/sap.py", line 203, in _run
    return func(**dic)
  File "/home/michele/oq-engine/openquake/commands/export.py", line 38, in main
    fnames = export_((datastore_key, fmt), dstore)
  File "/home/michele/oq-engine/openquake/baselib/general.py", line 571, in __call__
    return self[key](obj, *args, **kw)
  File "/home/michele/oq-engine/openquake/calculators/export/hazard.py", line 426, in export_gmf_data_csv
    df['csi'] = decode(sitecol.custom_site_id[df.sid])
IndexError: index 698 is out of bounds for axis 0 with size 686