Use BoldM type for fault magnitudes in Magnitudes config#105
Use BoldM type for fault magnitudes in Magnitudes config#105AndrewRidden-Harper wants to merge 7 commits into
Conversation
source_modelling 2026.6.1 introduces the BoldM magnitude NewType. Update the Magnitudes config to use BoldM instead of float, and make call sites across the codebase consistent (bump dependency, cast floats to BoldM, pass bold_m=True to magnitude_to_moment). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the workflow to use the BoldM type from source_modelling.magnitude_scaling for magnitudes instead of raw floats, ensuring proper magnitude scaling. This includes updating tests, script files, and dependency versions in pyproject.toml and uv.lock. The review feedback highlights a missing import of magnitude_scaling in gcmt_to_realisation.py which would cause a runtime NameError, and points out typos and incorrect syntax in a type-ignore comment in nshm2022_to_realisation.py.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
lispandfound
left a comment
There was a problem hiding this comment.
LGTM barring the conversion of magnitude types in gcmt-to-realisation.
Co-authored-by: Jake Faulkner <jakefaulkn@gmail.com>
Co-authored-by: Jake Faulkner <jakefaulkn@gmail.com>
Commit e4aac3d switched genslip to srf_version=2.0, but test_build_genslip_command_static_args still expected 1.0. Update the test's expected arg set to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
source_modelling2026.6.1 introduces theBoldMmagnitudeNewType. Thisupdates the
Magnitudesrealisation config to useBoldMinstead offloat,and makes call sites across the codebase consistent.
Changes
source_modellingdependency to>=2026.6.1(pyproject.toml,uv.lock)Magnitudes.magnitudesand__getitem__now useBoldMBoldMwhen constructingMagnitudes(gcmt_to_realisation,nshm2022_to_realisation, tests)bold_m=Truetomoment.magnitude_to_momentforBoldMmagnitudes,preserving the existing runtime default (
generate_domain,realisation_to_srf)Notes
nshm2022_to_realisation, the magnitudes dict is shared withnshmdb.most_likely_fault(whosedict[str, float]is invariant), so theMagnitudes(...)construction uses a scoped# ty: ignore[invalid-argument-type]— safe because
BoldMis afloatNewType(identity at runtime).