test: Delaunay pixel-area known-answer tests + areas_for_magnification docstring (#522) - #523
Merged
Merged
Conversation
…_magnification semantics (#522) Phase 8 of the euclid-dr1-prep epic: source audit of the Delaunay area / magnification paths. Lands the missing direct tests for MeshGeometryDelaunay.areas_for_magnification and barycentric_dual_area_from, and rewrites the areas_for_magnification docstring to what the code actually does (Voronoi cell areas; only unbounded cells zeroed; not the interpolant's dual areas). No behavioural change. Two tests deliberately pin the current, flagged semantics so the follow-up fix flips them on purpose. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rb8WYoovPNvwCj1AD7QpBq
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.
Summary
Phase 8 of the
euclid-dr1-prepepic (refs #522): a source audit of the Delaunay pixel-area and magnification code paths. This PR lands the audit's test deliverable and corrects one docstring; it changes no behaviour.MeshGeometryDelaunay.areas_for_magnificationhad no direct test anywhere. Three known-answer tests now pin what it computes: a 5×5 unit lattice (interior cells exactly 1.0, hull cells zeroed, sum(n-2)²), the fact that bounded boundary cells are kept (only unbounded Voronoi regions are zeroed), and that repeat calls agree without writing the-1sentinel back.barycentric_dual_area_fromgets four tests: single-triangleA/3, sum equals the convex-hull area exactly, exact integration of a linear field, and NumPy-vs-JAX in-graph parity (pinned through the split-point observable).areas_for_magnificationdocstring now says what the code does: Voronoi cell areas fromvoronoi_areas_numpy, only unbounded cells zeroed, bounded boundary cells kept, and that these are not the barycentric dual areas the Delaunay interpolator uses, soΣ reconstruction × areasis not the integral of the reconstruction.The audit itself found a real defect on this path (the Voronoi denominator biases magnification; the exact quadrature weight for the barycentric-linear mapper is the dual area) and a second, independent one in the
magnificationlatent for pixelized sources. Both are filed as separate bug prompts and are not fixed here; the full audit is posted on #522. The two tests that pin the current semantics carry comments saying a fix must flip them deliberately.API Changes
None — internal changes only (tests and a docstring).
See full details below.
Test Plan
pytest test_autoarray/inversion -q— 475 passedpytest test_autoarray -xin the task worktree (ship gate)Full API Changes (for automation & release notes)
Changed Behaviour
Added
test_autoarray/inversion/pixelization/mesh_geometry/test_delaunay.py(+3),test_autoarray/inversion/pixelization/interpolator/test_delaunay.py(+4).Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Rb8WYoovPNvwCj1AD7QpBq