Source model filter in calc-config
Use case
As a software and model tester, it would be useful to have a way to filter the source model during a calculation in order to reduce the number of steps and opportunities for errors.
Description
Sensitivity testing during code and model development often requires running a subset of a NSHM. For example, for a specific tectonic setting, source type, geographic region (state, e.g.), or even an individual source. Currently, running a subset of a model requires modifying a local copy of the NSHM for a local calculation or pushing up a branch to GitLab/GitHub that only includes the target sources for AWS runs. Setting up for either case requires multiple steps, possibly repeated for each test iteration, and multiple copies of files or temporary git branches, leading to more opportunities for errors.
Possible filter functionality
A filter block in the calc-config file could allow a subset of a model to be run without modifying the NSHM. This would (may?) require parsing calc-config.json
before parsing the NSHM, the reverse of the current parsing order. The example below would run only sources of type fault
in tectonic setting active-crust
. To include all sources in the tectonic setting, omit "source-type"
or set it equal to null
.
"model-filter": {
"tectonic-setting": ["active-crust"],
"source-type": ["fault"]
}
- Filter block as a child of
"hazard"
or as a separate top-level element? - Allow filter for source ID or name?
- More complicated filtering
"model-filters": [ MODEL_FILTER_1, MODEL_FILTER_2, ... ]
for "MODEL_FILTER_1" OR "MODEL_FILTER_2", ... - Negative filter - run all sources except
MODEL_FILTER