Skip to content

Commit

Permalink
Merge pull request #10424 from gem/mmi_values
Browse files Browse the repository at this point in the history
Temporarily disabled `get_mmi_values` for many assets
  • Loading branch information
micheles authored Mar 7, 2025
2 parents 021be14 + 0e6a6f9 commit 6c36004
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions openquake/calculators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,13 @@ def pre_execute(self):
self.read_inputs()
self.save_crmodel()
if oq.impact and 'mmi' in oq.inputs:
logging.info('Computing MMI-aggregated values')
if mmi_values := self.assetcol.get_mmi_values(
oq.aggregate_by, oq.inputs['mmi']):
self.datastore['mmi_tags'] = mmi_values
if len(self.assetcol) < 10_000:
logging.info('Computing MMI-aggregated values')
if mmi_values := self.assetcol.get_mmi_values(
oq.aggregate_by, oq.inputs['mmi']):
self.datastore['mmi_tags'] = mmi_values
else:
logging.info('Too many assets to aggregate by MMI!')

def pre_execute_from_parent(self):
"""
Expand Down

0 comments on commit 6c36004

Please sign in to comment.