Repository navigation
refactor: PropertyGrid takes its geometry from StructuredGrid3DGeometry - #368
Merged
lachlangrose merged 1 commit intoNov 1, 2026
Conversation
This was referenced Oct 29, 2026
lachlangrose
force-pushed
the
refactor/property-grid-geometry
branch
from
November 1, 2026 05:51
5bfb9b1 to
196fcb0
Compare
lachlangrose
changed the base branch from
master
to
prototype/support-extends-geometry
November 1, 2026 05:51
lachlangrose
force-pushed
the
refactor/property-grid-geometry
branch
from
November 1, 2026 06:08
196fcb0 to
8234298
Compare
lachlangrose
marked this pull request as ready for review
November 1, 2026 06:12
…ry and adds cell lookup PropertyGrid re-implemented maximum, nodes and cell_centres with its own linspace/meshgrid code. It now builds a StructuredGrid3DGeometry from its origin, step_vector and nsteps (the number of nodes) and delegates to it, so the node/cell convention is defined in one place. The public fields are unchanged. New: geometry, nsteps_cells, n_nodes, n_cells, inside(points), cell_index_at(points) (flat cell index in cell_properties order, -1 outside) and cell_value_at(name, points) (NaN outside). Points are in the grid's own frame; the grid is not rotated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
lachlangrose
force-pushed
the
refactor/property-grid-geometry
branch
from
November 1, 2026 06:54
8234298 to
16c2409
Compare
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.
Step 3 of consolidating the structured-grid geometry code: the results container reuses the shared geometry class instead of carrying its own copy.
Change
PropertyGrid(the results container renamed in #363) re-implementedmaximum,nodesandcell_centreswith its ownlinspace/meshgridcode. It now builds aStructuredGrid3DGeometryfrom itsorigin,step_vectorandnsteps(the number of nodes) and delegates to it. The dataclass fields are unchanged, so constructor calls, pickles andto_dictare unaffected. The geometry is rebuilt on access rather than stored, so it can never go out of sync with the fields.New, all from the shared geometry:
geometry,nsteps_cells,n_nodes,n_cellsinside(points)cell_index_at(points): flat index of the cell each point falls in, in the same order ascell_propertiesandcell_centres(x fastest);-1for points outside; points on the maximum boundary belong to the last cellcell_value_at(name, points): the cell property in that cell, NaN outside; works for scalar and vector cell dataPoints are in the grid's own frame.
PropertyGridhas no rotation, and neither lookup applies one.Tests
packages/loop_common/tests/test_property_grid.py(30 tests, three grids: integer unit grid, offset anisotropic, minimal):nodesandcell_centresequal independentmeshgridconstructions (so delegating did not change them)every cell centre is in its own cell;
cell_value_atreturns the right values for random points; boundary and outside points; vector-valued cell dataMutation check: indexing cell data with node strides instead of cell strides fails 8 of the 30
packages/loop_common/tests: 213 passedpackages/loop_interpolation/tests: 606 passed, 46 skipped, 2 xfailedtests: 737 passed, 6 skippedruff: no new findings
Not in this PR
BoundingBox.structured_grid()still returns the interpolation support, not aPropertyGrid.🤖 Generated with Claude Code