feat(stilt): JacobianBuilder.build_from_grid (0.1.0b4)#3
Merged
Conversation
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
JacobianBuilder.build_from_grid— builds the Jacobian from an xarray target grid (lon/latorx/y;NaN-masked cells) or a coords list, conservatively regridding each footprint onto it viaFootprint.aggregate.build_from_coordsbecomes a thin wrapper forwarding to a shared_build()._build_jacobian_row()plus the path loader; targets (coords or grid) pass straight through toaggregate.Also repairs
tests/test_stilt_builder.py, which was broken onmain(it imported a renamed worker and mocked the removed.load()API). Rewritten against the currentpaths()/from_netcdfworker, with grid-target coverage.Requires
pystilt>=0.1.0a3(the conservativeFootprint.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.