Skip to content

Conversation

@CB-quakemodel
Copy link
Contributor

@CB-quakemodel CB-quakemodel commented Jan 4, 2026

CONTEXT

The way conditional GMPEs are currently handled is quite messy and there are several problems with their current implementations which we need to correct.

These issues include:

  1. Currently, we cannot specify a different ConditionalGMPE for each IMT. This new approach allows the specification of a different conditional GMPE for each required IMT as follows (here for IA and PGV) using ModifiableGMPE syntax:
image
  1. In the current implementations, if the conditional GMPE does not support a requested IMT, then the underlying GSIM is used instead without warning. This behaviour is silent and therefore rather dangerous (the user might not realise that the predictions for an IMT are actually from the underlying GMM rather than the conditional GMPE they mistakenly thought could be used for the given IMT). The silent provision of the underlying GMPE's predictions is something that should always be forbidden.

  2. There are currently some hackish approaches for ensuring that all of the IMTs required for a calculation are available (which are causing the silent passing of the underlying GSIMs predictions if not supported by the conditional GMPE). The new approach safely manages which IMT's predictions are from the underlying GSIM and which are from the conditional GMPEs (see the compute methods of ModifiableGMPE and the currently available conditional GMPEs in OQ).

PR FEATURES

This PR addresses these issues by using ModifiableGMPE and a dictionary style syntax to permit explicit use of a different conditional GMPE (when required) for each IMT. The base GMM is then used for all other IMTs specified within the job file. The currently available conditional GMPEs (Macedo et al. 2019 and Abrahamson and Bhasin 2020) are refactored accordingly to work with this approach (now they are much simpler - additional conditional GMPEs can use these as implementation guides).

All of the existing GSIM unit tests and QA tests using conditional GMPEs pass using this ModifiableGMPE approach/syntax.

For the use of ModifiableGMPE to specify the conditional GMPE for each period, a modified (and fully viable) version of the each conditional GMPE's compute method is used (which is much cleaner/simpler too given it removes the hackish approaches mentioned above).

The documentation has been updated to provide guidance on implementing conditional GMPEs. One of the key differences is that conditional GMPEs require REQUIRES_IMTS (which is different to DEFINED_FOR_INTENSITY_MEASURE_TYPES) and uses a modified compute method. A flag of conditional = True must be set in the parent GSIM class too which is checked when the conditional GMPE is being instantiated within ModifiableGMPE (prevent non-conditional GMPEs being used in this ModifiableGMPE capability).

This PR is of interest to (hopefully) definitively resolving the conditional GMPE issues discussed previously in #9897

@CB-quakemodel CB-quakemodel linked an issue Jan 6, 2026 that may be closed by this pull request
@CB-quakemodel CB-quakemodel requested a review from micheles January 7, 2026 16:22
Copy link
Member

@mmpagani mmpagani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Chris. Nice work!

@micheles micheles merged commit 97c8370 into master Jan 8, 2026
8 checks passed
@micheles micheles deleted the mgmpe_cond branch January 8, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New CAV models

5 participants