Skip to content

OQ Args

This is the base class for both OQ hazard and OQ disaggregation.

OQArgs

Bases: BaseModel

Base class for OpenQuake task arguments.

Validators
  • If nshm_model_version not given, must provide srm_logic_tree, gmcm_logic_tree, and hazard_config.
  • All files must exist either relative to input file or as absolute path.

Parameters:

Name Type Description Default
compatible_calc_id str

Identifies hazard run with similar software and settigs such that results can be compared.

required
nshm_model_version str | None

An official released NSHM model. Includes logic trees and calculation configuration (i.e. OQ settings).

None
srm_logic_tree SourceLogicTree | Path | None

Seismicity rate model logic tree.

None
gmcm_logic_tree GMCMLogicTree | Path | None

Ground motion model logic tree.

None
hazard_config OpenquakeConfig | Path | None

OpenQuake settings.

None
vs30 Annotated[int, Gt] | None

Uniform site vs30.

None
locations list[str] | None

Location strings as used by nzshm-common.

None
locations_file Path | None

A file with lon, lat locations, and optinoally vs30.

None
locations_file_id str | None

A toshi ID of a file with lon, lat locations, and optinoally vs30.

None

Attributes

model_config = ConfigDict(arbitrary_types_allowed=True) class-attribute instance-attribute

compatible_calc_id: Annotated[str, AfterValidator(_is_compat_calc_id)] instance-attribute

Identifies hazard run with similar software and settigs such that results can be compared.

nshm_model_version: Annotated[Optional[str], AfterValidator(_is_model_version)] = None class-attribute instance-attribute

An official released NSHM model. Includes logic trees and calculation configuration (i.e. OQ settings).

srm_logic_tree: Optional[SourceLogicTree | Path] = None class-attribute instance-attribute

Seismicity rate model logic tree.

gmcm_logic_tree: Optional[GMCMLogicTree | Path] = None class-attribute instance-attribute

Ground motion model logic tree.

hazard_config: Optional[OpenquakeConfig | Path] = None class-attribute instance-attribute

OpenQuake settings.

vs30: Optional[PositiveInt] = None class-attribute instance-attribute

Uniform site vs30.

locations: Optional[list[str]] = None class-attribute instance-attribute

Location strings as used by nzshm-common.

locations_file: Optional[Path] = None class-attribute instance-attribute

A file with lon, lat locations, and optinoally vs30.

locations_file_id: Optional[str] = None class-attribute instance-attribute

A toshi ID of a file with lon, lat locations, and optinoally vs30.

Functions

check_logic_trees() -> Self

abs_path(value: Any, info: ValidationInfo) -> Any classmethod

If any of the fields are paths, resolve the absolute path and check that it exists.

ser_hazard_config(value: Any) -> Any

validate_hazard_config(value: Any) -> Any classmethod

check_locations() -> Self