-
Notifications
You must be signed in to change notification settings - Fork 305
Completely refactor conditional GMPEs to be specified within ModifiableGMPE for better/safer handling #11090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+732
−249
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LanaTodorovic93
approved these changes
Jan 5, 2026
Closed
micheles
reviewed
Jan 7, 2026
micheles
reviewed
Jan 7, 2026
micheles
reviewed
Jan 7, 2026
mmpagani
approved these changes
Jan 7, 2026
Member
mmpagani
left a comment
There was a problem hiding this 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
reviewed
Jan 8, 2026
micheles
reviewed
Jan 8, 2026
micheles
approved these changes
Jan 8, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.
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
computemethod 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 toDEFINED_FOR_INTENSITY_MEASURE_TYPES) and uses a modifiedcomputemethod. A flag ofconditional = Truemust 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