Repository navigation
feat: interpolated view of Delaunay/kNN source reconstructions - #701
Merged
Merged
Conversation
Delaunay/kNN reconstructions are drawn as flat-shaded triangles, which show where the mesh spends resolution but are not the interpolant the likelihood uses between vertices (Discussion PyAutoLabs/.github#46). - plot_inversion_reconstruction / plot_mapper gain `interpolated=True`: a fresh interpolator of the mapper's own type (same mesh and mesh_grid) is evaluated on a uniform plot grid over the panel extent and drawn with imshow, so the figure equals mapping_matrix @ reconstruction. Barycentric for Delaunay, kNN / Sibson weights for those meshes; outside the mesh hull is transparent; log scales clip to the norm floor; rectangular meshes ignore the flag. - interpolated_reconstruction_from / mapper_has_interpolated_view helpers. - inversion_#.png panel 11: "Source Reconstruction (Interpolated)" for irregular meshes. - Flat triangles stay the default; the _plot_delaunay docstring now says plainly what they show and what they do not. - config: visualize/general.yaml inversion.interpolated_pixels (400) and plots.yaml fit.subplot_fit_source_interpolated (false), read by the PyAutoLens fit plotters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016nhQ8MtKvVD9fBkNBqcMb4
This was referenced Nov 17, 2026
…restores mid zoom fit.subplot_fit_source_interpolated now defaults to true. With an irregular-mesh source, fit.png right-hand column is max zoom, no zoom (flat triangles) and the likelihood interpolant bottom right; false (or a rectangular / parametric source) restores max, mid and no zoom. Human decision on PyAutoArray#700, 2026-11-17. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016nhQ8MtKvVD9fBkNBqcMb4
The kNN interpolators import jax, so their mapping-matrix cases fail on the no-jax CI leg (unittest-nojax). Skip them there, as the repository's other jax-dependent tests do; Delaunay and DelaunayNN cases still run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016nhQ8MtKvVD9fBkNBqcMb4
Irregular-mesh inversion_#.png puts the source plane in the right-hand column like the lens fit.png: Source Plane (Max Zoom), Source Plane (Interpolated) over the max-zoom extent, Source Plane (No Zoom). Rectangular meshes keep their layout unchanged. The interpolated panel is now square with a full-height colorbar (imshow no longer resets the box aspect). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Closes #700. Delaunay/kNN source reconstructions are drawn as flat-shaded triangles. These show where the mesh spends resolution, but they are not the interpolant the likelihood uses between vertices, as reported on PyAutoLabs/.github#46.
plot_mapperandplot_inversion_reconstructionstill draw flat triangles by default. The_plot_delaunaydocstring now says plainly what they show and what they do not.meshandmesh_grid, and evaluates it on a uniform plot grid over the panel extent (400×400 by default, configurable). The result is drawn withimshow.mapping_matrix @ reconstruction: barycentric weights forDelaunay, the mesh's own weights for kNN, KNNBarycentric and DelaunayNN.inversion_#.png(irregular meshes): the right-hand column holds the source plane, matching the lensfit.png: "Source Plane (Max Zoom)" (panel 3), "Source Plane (Interpolated)" (panel 7, max-zoom extent) and "Source Plane (No Zoom)" (panel 11, always bottom right). Mesh Pixel Grid Overlaid, Noise-Map and Regularization move to panels 4–6. The interpolated panel is square, with a colorbar the full height of the panel. Rectangular inversions are pixel-identical to main.visualize/general.yamlgetsinversion: interpolated_pixels: 400.plots.yamlgetsfit: subplot_fit_source_interpolated: true. PyAutoLens reads it (feat: fit.png switch for the interpolated source panel PyAutoLens#864): by default the interpolated panel is in the middle of the right-hand column offit.png, between Max Zoom and No Zoom, andfalseputs Mid Zoom there instead.API Changes
Added only; nothing removed or changed.
plot_inversion_reconstruction/plot_mappergaininterpolated=Falseandinterpolated_shape_native=None.autoarray.plot.inversion:interpolated_reconstruction_fromandmapper_has_interpolated_view.subplot_of_mapperuses a new layout for irregular meshes: Max Zoom / Interpolated / No Zoom in the right-hand column.See full details below.
Test Plan
test_autoarray/plot/test_inversion_interpolated.py, 11 new tests:mapping_matrix @ reconstructionon the plot grid, for Delaunay, KNearestNeighbor, KNNBarycentric and DelaunayNN;interpolated=Truedraws a raster and the default draws triangles;python -m pytest test_autoarray: 2399 passed, 70 skipped. After the layout changes (e8a174a6): 2470 passed (laptop).mapping_matrix @ reconto 1.8e-15;Heart: the published board was GREEN (2026-11-17T15:25Z), with no blockers on the touched repos.
Full API Changes (for automation & release notes)
Added
autoarray.plot.inversion.interpolated_reconstruction_from(mapper, pixel_values, extent, shape_native=None) -> np.ndarray: the mapper's interpolant on a uniform grid; NaN outside the mesh hull.autoarray.plot.inversion.mapper_has_interpolated_view(mapper) -> bool: True for Delaunay, kNN and natural-neighbour mappers.plot_inversion_reconstruction(..., interpolated=False, interpolated_shape_native=None).autoarray.inversion.plot.mapper_plots.plot_mapper(..., interpolated=False, interpolated_shape_native=None).visualize/general.yamlinversion.interpolated_pixels: 400;visualize/plots.yamlfit.subplot_fit_source_interpolated: true.Changed Behaviour
subplot_of_mapper(inversion_#.png) with irregular meshes: right-hand column = Source Plane (Max Zoom) / Source Plane (Interpolated) / Source Plane (No Zoom); Mesh Pixel Grid Overlaid, Noise-Map and Regularization move to panels 4–6. Rectangular meshes are unchanged.Migration
Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_016nhQ8MtKvVD9fBkNBqcMb4