Skip to content

Use BoldM type for fault magnitudes in Magnitudes config#105

Open
AndrewRidden-Harper wants to merge 7 commits into
pegasusfrom
use-explicit-boldm-convention
Open

Use BoldM type for fault magnitudes in Magnitudes config#105
AndrewRidden-Harper wants to merge 7 commits into
pegasusfrom
use-explicit-boldm-convention

Conversation

@AndrewRidden-Harper

Copy link
Copy Markdown
Contributor

Summary

source_modelling 2026.6.1 introduces the BoldM magnitude NewType. This
updates the Magnitudes realisation config to use BoldM instead of float,
and makes call sites across the codebase consistent.

Changes

  • Bump source_modelling dependency to >=2026.6.1 (pyproject.toml, uv.lock)
  • Magnitudes.magnitudes and __getitem__ now use BoldM
  • Cast floats to BoldM when constructing Magnitudes (gcmt_to_realisation,
    nshm2022_to_realisation, tests)
  • Pass bold_m=True to moment.magnitude_to_moment for BoldM magnitudes,
    preserving the existing runtime default (generate_domain, realisation_to_srf)

Notes

  • In nshm2022_to_realisation, the magnitudes dict is shared with
    nshmdb.most_likely_fault (whose dict[str, float] is invariant), so the
    Magnitudes(...) construction uses a scoped # ty: ignore[invalid-argument-type]
    — safe because BoldM is a float NewType (identity at runtime).

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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread workflow/scripts/gcmt_to_realisation.py
Comment thread workflow/scripts/nshm2022_to_realisation.py Outdated

@lispandfound lispandfound left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM barring the conversion of magnitude types in gcmt-to-realisation.

Comment thread workflow/scripts/gcmt_to_realisation.py Outdated
Comment thread workflow/scripts/gcmt_to_realisation.py Outdated
AndrewRidden-Harper and others added 3 commits June 5, 2026 16:35
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>
AndrewRidden-Harper and others added 2 commits June 9, 2026 13:48
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants