Skip to content

feat(stilt): JacobianBuilder.build_from_grid (0.1.0b4)#3

Merged
jmineau merged 2 commits into
mainfrom
feat/build-from-grid
Jun 17, 2026
Merged

feat(stilt): JacobianBuilder.build_from_grid (0.1.0b4)#3
jmineau merged 2 commits into
mainfrom
feat/build-from-grid

Conversation

@jmineau

@jmineau jmineau commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What

Adds JacobianBuilder.build_from_grid — builds the Jacobian from an xarray target grid (lon/lat or x/y; NaN-masked cells) or a coords list, conservatively regridding each footprint onto it via Footprint.aggregate.

  • build_from_coords becomes a thin wrapper forwarding to a shared _build().
  • The worker is split into a mockable _build_jacobian_row() plus the path loader; targets (coords or grid) pass straight through to aggregate.
  • Advances the "build Jacobian from geometries or nested grid" roadmap item.

Also repairs tests/test_stilt_builder.py, which was broken on main (it imported a renamed worker and mocked the removed .load() API). Rewritten against the current paths() / from_netcdf worker, with grid-target coverage.

Requires

pystilt>=0.1.0a3 (the conservative Footprint.aggregate; see jmineau/PYSTILT#2). CI and the lockfile will resolve once pystilt 0.1.0a3 is published.

Validation

ruff clean and the 12 builder tests pass (mocked). Cuts release 0.1.0b4.

jmineau added 2 commits June 17, 2026 14:24
Build the Jacobian from an xarray target grid (lon/lat or x/y; NaN-masked
cells) or a coords list, conservatively regridding each footprint onto it via
Footprint.aggregate. build_from_coords becomes a thin wrapper forwarding to a
shared _build(); the worker is split into a mockable _build_jacobian_row() plus
the path loader, and targets (coords or grid) pass straight through to
aggregate. Advances the "build Jacobian from geometries or nested grid" item.

Also repairs tests/test_stilt_builder.py, which was broken (it imported a
renamed worker and mocked the removed .load() API); rewritten against the
current paths()/from_netcdf worker with grid-target coverage.

Committed with --no-verify: the pre-commit uv hooks cannot resolve the
unpublished pystilt>=0.1.0a3 pin yet; ruff/pytest/pyright were run manually
against the existing .venv.
Move the Unreleased entries (build_from_grid + the pystilt>=0.1.0a3 bump) under
0.1.0b4 and bump the version. Requires pystilt 0.1.0a3 (conservative aggregate);
the lockfile / CI will resolve once pystilt 0.1.0a3 is published.

Committed with --no-verify (see prior commit): pre-commit uv hooks cannot
resolve the unpublished pystilt pin yet.
@codecov-commenter

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@jmineau jmineau merged commit 180eb4f into main Jun 17, 2026
11 of 24 checks passed
@jmineau jmineau deleted the feat/build-from-grid branch June 17, 2026 21:50
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