Skip to content

Document that jump_points_from_rupture_tree min_depth is in kilometres - #107

Merged
lispandfound merged 1 commit into
mainfrom
fix/94-min-depth-units-docstring
Sep 9, 2026
Merged

Document that jump_points_from_rupture_tree min_depth is in kilometres#107
lispandfound merged 1 commit into
mainfrom
fix/94-min-depth-units-docstring

Conversation

@lispandfound

Copy link
Copy Markdown
Contributor

Fixes #94

Problem

min_depth was documented without a unit:

min_depth : float | None, optional
    The minimum depth to consider jumping between, or ``None`` to allow jumps at all depths.

It is kilometres — :530 divides source.bottom_m by 1000 before comparing, and sources.closest_points_beneath multiplies by _KM_TO_M on entry.

Every other distance in this module and in sources.Point / sources.Plane is metres, and says so in the attribute name (bottom_m, top_m, width_m, length_m). A caller who follows the surrounding convention and passes metres gets no error: the min(min_depth, 0.99 * bottom_m / 1000, ...) clamp silently reduces the value to the fault bottom, so min_depth=5000 is treated as "as deep as possible" and the jump points are computed at the fault bottom instead of at 5 km.

sources.closest_points_beneath already gets this right (sources.py:1682-1683, "in kilometres"); the public wrapper just did not repeat it.

Changes

Docstring only, matching the wording already used in sources.closest_points_beneath.

Not addressed here

Whether a min_depth far below every source should raise rather than clamp is the thing that makes the unit error silent, but changing it is a behaviour change — left on the issue for a maintainer decision rather than bundled into a docs fix.

Verification

  • pytest tests/test_rupture_propagation.py — 26 passed.
  • ruff check, ruff format, numpydoc lint clean.

🤖 Generated with Claude Code

Every other distance in this module and in sources.Point/sources.Plane is
metres and says so in the attribute name (bottom_m, top_m, width_m). A
caller following that convention and passing metres gets no error: the
min() clamp silently reduces the value to the fault bottom, so
min_depth=5000 is treated as "as deep as possible".

sources.closest_points_beneath already documents the unit; the public
wrapper just did not repeat it.

Fixes #94

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lispandfound
lispandfound merged commit 249da79 into main Sep 9, 2026
7 checks passed
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.

rupture_propagation.py: min_depth units undocumented, and a metres value is silently clamped instead of rejected

1 participant