Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies = [
# UCGMSim Dependencies
"im-calculation>=2025.12.5",
"velocity-modelling>=2026.2.1",
"nshmdb>=2025.12.1",
"nshmdb>=2026.09.1",
"oq_wrapper>=2025.12.3",
"qcore-utils>=2025.12.2",
"source_modelling>=2026.08.1",
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions workflow/scripts/nshm2022_to_realisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from scipy.cluster.hierarchy import DisjointSet

from nshmdb import nshmdb
from nshmdb.nshmdb import FaultSystem
from qcore import cli
from qcore.uncertainties import distributions
from source_modelling import magnitude_scaling, moment, rupture_propagation, sources
Expand Down Expand Up @@ -187,6 +188,7 @@ def generate_realisation(
DefaultsVersion,
typer.Argument(),
],
fault_system: Annotated[FaultSystem, typer.Option()] = FaultSystem.Crustal,
initial_fault: Annotated[
str | None,
typer.Option(),
Expand Down Expand Up @@ -252,6 +254,10 @@ def generate_realisation(
Location to write out the realisation.
defaults_version : DefaultsVersion
Scientific default parameters version to use.
fault_system : FaultSystem, optional
The NSHM fault system rupture_id belongs to. Defaults to Crustal.
rupture_id is an NSHM id, unique only within one fault system, not
a database primary key.
initial_fault : str, optional
The name of the fault to use as the initial fault for rupture
propagation. If not specified, the initial fault will be drawn
Expand Down Expand Up @@ -311,7 +317,8 @@ def generate_realisation(
realisation_ffp, defaults_version
)
db = nshmdb.NSHMDB(nshmdb_path)
faults = db.get_rupture_faults(rupture_id)
db.connect()
faults = db.get_rupture_faults(fault_system, rupture_id)
faults = {
fault_name: sources.simplify_fault(fault, srf_config.resolution)
for fault_name, fault in faults.items()
Expand All @@ -322,7 +329,7 @@ def generate_realisation(
f"Initial fault '{initial_fault}' not found in rupture. Options are {', '.join(list(faults))}"
)
raise typer.Exit(code=1)
faults_info = db.get_rupture_fault_info(rupture_id)
faults_info = db.get_rupture_fault_info(fault_system, rupture_id)
seeds = Seeds.read_from_realisation_or_random(realisation_ffp)
np.random.seed(seed=seeds.nshm_to_realisation_seed)
random.seed(seeds.nshm_to_realisation_seed)
Expand Down Expand Up @@ -355,7 +362,7 @@ def generate_realisation(
# The ty ignore below can be removed once NSHM2022DB merges the change to
# accept dict[str, BoldM] in most_likely_fault (branch support-BoldM-in-workflow).
mfds_rates = db.most_likely_fault(
nshmdb.FaultSystem.Crustal,
fault_system,
rupture_id,
magnitudes, # ty: ignore[invalid-argument-type]
)
Expand Down
Loading