Support nshmdb's fault_system-scoped rupture/fault lookups - #148
Merged
Conversation
nshmdb 2026.8.x merges Hikurangi/Puysegur/Crustal into one rupture_id space and requires fault_system alongside the NSHM id for get_rupture_faults/get_rupture_fault_info (NSHM2022DB PR pending -- see fix-fault-system-scoping-in-rupture-fault-lookups), and a 3rd positional arg on most_likely_fault. generate_realisation gains an optional fault_system option, defaulting to Crustal (this project's only fault system so far), threaded through all three call sites. Also calls db.connect() explicitly -- NSHMDB.connection() now raises unless the connection was opened via connect()/__enter__ first; the old package connected implicitly. Verified end-to-end against nshmdb_v2026.08.3.db (rupture 3): faults grouped and named correctly, rakes preserved. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The parenthetical sat after "NSHM id", reading as if the id were a FaultSystem. The id is a plain int; FaultSystem is already the declared type of the parameter itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
AndrewRidden-Harper
marked this pull request as ready for review
September 1, 2026 11:11
lispandfound
previously approved these changes
Sep 2, 2026
Conflict in workflow/scripts/nshm2022_to_realisation.py: "Update CI (#135)" independently adapted the most_likely_fault call to nshmdb 2026.8.3's new leading fault_system argument by hardcoding nshmdb.FaultSystem.Crustal, while this branch threads the value through from the new --fault-system option. Kept pegasus's multi-line call layout (and the ty ignore on the magnitudes argument, still needed since most_likely_fault declares dict[str, float]) with fault_system in place of the hardcoded literal. Everything else merged cleanly: pegasus's dict(faults) invariance casts and this branch's db.connect()/fault_system lookups sit in disjoint hunks, and uv.lock's textual merge is consistent (uv lock --check passes). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019GHytYmpgE1CqWVKbzYWKe
lispandfound
approved these changes
Sep 2, 2026
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
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.
Summary
rupture_idspace;get_rupture_faults/get_rupture_fault_infoneedfault_systemalongside the NSHM id, andmost_likely_faulttakes a 3rd positional arg.generate_realisationgains an optionalfault_systemoption (defaultCrustal, this project's only fault system so far), threaded through all three call sites.db.connect()explicitly —NSHMDB.connection()now raises unless the connection was opened viaconnect()/__enter__first; the old package connected implicitly.get_rupture_faults/get_rupture_fault_infodon't acceptfault_systemyet on any released nshmdb version — this PR's diff won't type/behave correctly againstpegasus's currently-locked 2026.8.3 until that one merges and releases). Opened as a draft for that reason.🤖 Generated with Claude Code