Skip to content

feat: shaken_points, ShakeGrid.points, index_of, require_g (0.3.0) - #7

Merged
gzileni merged 1 commit into
mainfrom
feat/shaken-points
Nov 28, 2026
Merged

gzileni merged 1 commit into
mainfrom
feat/shaken-points

Conversation

@gzileni

@gzileni gzileni commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Limen becomes a thin application and its single-domain ShakeMap logic moves here, as pure functions with plain types in and out. Version 0.3.0.

  • shaken_points(grid, points, min_pga_g, *, method="nearest"): (key, PGA in g) of the points shaken at least a threshold the caller passes (no default). It is Limen's celle_scosse.
  • ShakeGrid.points(): longitude and latitude of every grid point, each (nlat, nlon) like column().
  • ShakeGrid.index_of(longitudes, latitudes) → (rows, cols, inside): the nearest grid point of many positions, ties to even. sample(..., method="nearest") now calls it, so the two cannot disagree.
  • ShakeGrid.require_g(name="PGA"): GridError unless the column exists and reads in g.
  • A test that the package imports no sister library, limen or limen_core.

points and index_of replace two computations Limen's co-seismic backtest writes by hand.

Epic

Part of agent-engineering-studio/limen#712 (landslide)

Verification

  • make check: ruff, mypy strict, 99 tests, 100% coverage.
  • Parity on fixed inputs against Limen's code at commit 89e1932, frozen into tests/test_shaken_points.py and tests/test_grid_points.py (copied, not imported): exact equality.
  • make docs builds with --strict.

🤖 Generated with Claude Code

Limen's single-domain ShakeMap logic moves into the library as pure
functions: the points shaken above a threshold the caller passes
(Limen's celle_scosse), the coordinates of every grid point and the
nearest grid index of many positions (hand-written in Limen's co-seismic
backtest). sample() now reads through index_of.

Parity tests against Limen's code at commit 89e1932, frozen into the
tests. A test bans imports of the sister libraries, limen and limen_core.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T14:27:00.184907Z 08704c2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@gzileni
gzileni merged commit 95e2cb9 into main Nov 28, 2026
4 checks passed
@gzileni
gzileni deleted the feat/shaken-points branch November 28, 2026 14:26
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.

1 participant