From 5eb35570dbc3402989cc856d8bf4b4c8cc9a1c87 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Fri, 10 Jul 2026 15:50:40 +0100 Subject: [PATCH] feat: PreloadsInterferometer passes mesh-geometry fields through Completes the D5 cross-dataset-type contract (PyAutoLens#599): an interferometer lead factor in a joint imaging+interferometer graph can now carry the shared source-plane mesh alongside its channel-invariant curvature matrix + mapper. Co-Authored-By: Claude Fable 5 --- autoarray/preloads/interferometer.py | 13 +++++++++++-- test_autoarray/preloads/test_preloads.py | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/autoarray/preloads/interferometer.py b/autoarray/preloads/interferometer.py index 0c5cbccd..b38269e9 100644 --- a/autoarray/preloads/interferometer.py +++ b/autoarray/preloads/interferometer.py @@ -2,7 +2,13 @@ class PreloadsInterferometer(AbstractPreloads): - def __init__(self, curvature_matrix=None, mapper_galaxy_dict=None): + def __init__( + self, + curvature_matrix=None, + mapper_galaxy_dict=None, + source_plane_mesh_grid=None, + image_plane_mesh_grid=None, + ): """ Preloaded quantities for an interferometer fit / inversion (see `AbstractPreloads`). @@ -24,5 +30,8 @@ def __init__(self, curvature_matrix=None, mapper_galaxy_dict=None): The pre-computed mapper(s) and their source association. See `AbstractPreloads`. """ super().__init__( - curvature_matrix=curvature_matrix, mapper_galaxy_dict=mapper_galaxy_dict + curvature_matrix=curvature_matrix, + mapper_galaxy_dict=mapper_galaxy_dict, + source_plane_mesh_grid=source_plane_mesh_grid, + image_plane_mesh_grid=image_plane_mesh_grid, ) diff --git a/test_autoarray/preloads/test_preloads.py b/test_autoarray/preloads/test_preloads.py index 81dcc72d..960ee475 100644 --- a/test_autoarray/preloads/test_preloads.py +++ b/test_autoarray/preloads/test_preloads.py @@ -27,3 +27,9 @@ def test__preloads_interferometer__mesh_fields_available_via_abstract(): assert preloads.curvature_matrix == "F" assert preloads.source_plane_mesh_grid is None assert preloads.image_plane_mesh_grid is None + + preloads = aa.PreloadsInterferometer( + curvature_matrix="F", source_plane_mesh_grid=[["mesh"]], image_plane_mesh_grid=[["im"]] + ) + assert preloads.source_plane_mesh_grid == [["mesh"]] + assert preloads.image_plane_mesh_grid == [["im"]]