feat: PreloadsImaging + shared source-plane mesh fields (multi-exposure shared-state, phase 2/4)#380
Merged
Merged
Conversation
…eloads The imaging sibling of PreloadsInterferometer (PyAutoArray#379): AbstractPreloads gains source_plane_mesh_grid + image_plane_mesh_grid (dataset-type-agnostic, so either dataset type can lead an imaging+interferometer graph). PreloadsImaging documents the imaging invariance contract: mesh geometry is shareable across exposures under one lens model; mapper / curvature matrix / blurred mapping matrix / regularization matrix are NOT (per-exposure PSFs + offsets; regularization may be data-adaptive). Co-Authored-By: Claude Fable 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
Adds the imaging half of the multi-exposure shared-state feature (PyAutoArray#379; design locked on PyAutoLens#599 D1–D6 + the regularization amendment):
AbstractPreloadsgains mesh-geometry fields so exposures of the same lens — same or different wavelengths, with per-exposure pixel offsets — can share one source-plane mesh, and a newPreloadsImagingsibling documents the imaging invariance contract.The contract differs from the datacube case (#344): datacube channels share one real-space grid, so the whole mapper and curvature matrix
Fare preloadable. Imaging exposures have per-exposure PSFs and pixel offsets, so only the source-plane mesh geometry is exposure-invariant — the mapper, mapping matrix, blurred mapping matrix and regularization matrix (per user amendment: regularization may be data-adaptive) are deliberately NOT preloadable this way. Each exposure maps its own (offset) data grid onto the shared mesh.The new fields live on
AbstractPreloads(notPreloadsImaging) because the mesh is dataset-type-agnostic: in a joint imaging + interferometer graph, either dataset type can be the lead factor.API Changes
All additive and backward compatible — no removals or renames.
aa.AbstractPreloads(... , source_plane_mesh_grid=None, image_plane_mesh_grid=None)— the shared source-plane mesh geometry (traced mesh centres) and its image-plane counterpart (lead-exposure frame, carried as metadata).aa.PreloadsImaging(source_plane_mesh_grid=None, image_plane_mesh_grid=None)(newautoarray/preloads/imaging.py), with the invariance-contract docstring.mapper_galaxy_dictdocstring now states its grid-identity validity condition explicitly.The consumer (mesh-preload reuse path in
TracerToInversion,AnalysisImaging.shared_state_from) is the paired PyAutoLens PR — this PR must merge first.Test Plan
python -m pytest test_autoarray/— full suite passes (896 tests)test_autoarray/preloads/test_preloads.py— field defaults + container semantics for all three classestest_autogalaxy/full suite against this branch (962 passed);test_autolens/full suite against both branchesFactorGraphModelshared-vs-unshared log-likelihood bit-identical;shared_state_fromcomputed once (lead factor only)Full API Changes (for automation & release notes)
Added
autoarray.preloads.imaging.PreloadsImaging(source_plane_mesh_grid=None, image_plane_mesh_grid=None)(exported asaa.PreloadsImaging).Changed Signature (backward compatible — new optional kwargs, default
None)AbstractPreloads.__init__(... , source_plane_mesh_grid=None, image_plane_mesh_grid=None)(inherited byPreloadsInterferometer).Migration
AnalysisImaging(shared_preloads=True)(PyAutoLens PR) or passaa.PreloadsImaging(source_plane_mesh_grid=...)explicitly.Autonomy
--autorun (Autonomy: safe, feature/medium): four-leg ship gate — tests ✅ (896 + 962 + full autolens suite), smoke ✅ (curated subsets, see issue), review ✅ CLEAN, Heart 🟡 YELLOW acknowledged by user (reason set on issue #379). Ends at PR-open; merge stays human.Part of the
multi_shared_state_examplesepic (phase 2/4). Closes #379 on merge of the pair.🤖 Generated with Claude Code