diff --git a/autoarray/inversion/inversion/settings.py b/autoarray/inversion/inversion/settings.py index bdd19dfa..7c2dc8b7 100644 --- a/autoarray/inversion/inversion/settings.py +++ b/autoarray/inversion/inversion/settings.py @@ -13,7 +13,7 @@ def __init__( use_w_tilde: bool = True, use_positive_only_solver: Optional[bool] = None, positive_only_uses_p_initial: Optional[bool] = None, - relocate_pix_border : Optional[bool] = None, + relocate_pix_border: Optional[bool] = None, force_edge_pixels_to_zeros: bool = True, force_edge_image_pixels_to_zeros: bool = False, image_pixels_source_zero=None, @@ -93,7 +93,6 @@ def positive_only_uses_p_initial(self): @property def relocate_pix_border(self): - if self._relocate_pix_border is None: return conf.instance["general"]["inversion"]["relocate_pix_border"] diff --git a/autoarray/inversion/mock/mock_image_mesh.py b/autoarray/inversion/mock/mock_image_mesh.py index e773b489..5ee5fece 100644 --- a/autoarray/inversion/mock/mock_image_mesh.py +++ b/autoarray/inversion/mock/mock_image_mesh.py @@ -20,3 +20,7 @@ def image_plane_mesh_grid_from( return adapt_data * self.image_plane_mesh_grid return self.image_plane_mesh_grid + + @property + def uses_adapt_images(self) -> bool: + return False diff --git a/autoarray/inversion/pixelization/image_mesh/abstract.py b/autoarray/inversion/pixelization/image_mesh/abstract.py index 2704dbe5..62b4f879 100644 --- a/autoarray/inversion/pixelization/image_mesh/abstract.py +++ b/autoarray/inversion/pixelization/image_mesh/abstract.py @@ -18,6 +18,10 @@ def __init__(self): def is_stochastic(self): return False + @property + def uses_adapt_images(self) -> bool: + raise NotImplementedError + def image_plane_mesh_grid_from( self, grid: Grid2D, adapt_data: Optional[np.ndarray] ) -> Grid2DIrregular: diff --git a/autoarray/inversion/pixelization/image_mesh/hilbert.py b/autoarray/inversion/pixelization/image_mesh/hilbert.py index add48108..bcf7a1bf 100644 --- a/autoarray/inversion/pixelization/image_mesh/hilbert.py +++ b/autoarray/inversion/pixelization/image_mesh/hilbert.py @@ -322,6 +322,10 @@ def image_plane_mesh_grid_from( return Grid2DIrregular(values=np.stack((drawn_y, drawn_x), axis=-1)) + @property + def uses_adapt_images(self) -> bool: + return True + @property def is_stochastic(self): return True diff --git a/autoarray/inversion/pixelization/image_mesh/kmeans.py b/autoarray/inversion/pixelization/image_mesh/kmeans.py index ada7c744..d34320eb 100644 --- a/autoarray/inversion/pixelization/image_mesh/kmeans.py +++ b/autoarray/inversion/pixelization/image_mesh/kmeans.py @@ -120,6 +120,10 @@ def image_plane_mesh_grid_from( values=kmeans.cluster_centers_, ) + @property + def uses_adapt_images(self) -> bool: + return True + @property def is_stochastic(self): return True diff --git a/autoarray/inversion/pixelization/image_mesh/overlay.py b/autoarray/inversion/pixelization/image_mesh/overlay.py index 7f4bb2e9..078e6673 100644 --- a/autoarray/inversion/pixelization/image_mesh/overlay.py +++ b/autoarray/inversion/pixelization/image_mesh/overlay.py @@ -241,3 +241,7 @@ def image_plane_mesh_grid_from( ) return Grid2DIrregular(values=mesh_grid) + + @property + def uses_adapt_images(self) -> bool: + return False diff --git a/autoarray/inversion/pixelization/mappers/rectangular.py b/autoarray/inversion/pixelization/mappers/rectangular.py index 0cf36cf3..0ab9b0b3 100644 --- a/autoarray/inversion/pixelization/mappers/rectangular.py +++ b/autoarray/inversion/pixelization/mappers/rectangular.py @@ -20,55 +20,55 @@ def __init__( run_time_dict: Optional[Dict] = None, ): """ - To understand a `Mapper` one must be familiar `Mesh` objects and the `mesh` and `pixelization` packages, where - the four grids grouped in a `MapperGrids` object are explained (`image_plane_data_grid`, `source_plane_data_grid`, - `image_plane_mesh_grid`,`source_plane_mesh_grid`) - - If you are unfamliar withe above objects, read through the docstrings of the `pixelization`, `mesh` and - `mapper_grids` packages. - - A `Mapper` determines the mappings between the masked data grid's pixels (`image_plane_data_grid` and - `source_plane_data_grid`) and the mesh's pixels (`image_plane_mesh_grid` and `source_plane_mesh_grid`). - - The 1D Indexing of each grid is identical in the `data` and `source` frames (e.g. the transformation does not - change the indexing, such that `source_plane_data_grid[0]` corresponds to the transformed value - of `image_plane_data_grid[0]` and so on). - - A mapper therefore only needs to determine the index mappings between the `grid_slim` and `mesh_grid`, - noting that associations are made by pairing `source_plane_mesh_grid` with `source_plane_data_grid`. - - Mappings are represented in the 2D ndarray `pix_indexes_for_sub_slim_index`, whereby the index of - a pixel on the `mesh_grid` maps to the index of a pixel on the `grid_slim` as follows: - - - pix_indexes_for_sub_slim_index[0, 0] = 0: the data's 1st sub-pixel maps to the mesh's 1st pixel. - - pix_indexes_for_sub_slim_index[1, 0] = 3: the data's 2nd sub-pixel maps to the mesh's 4th pixel. - - pix_indexes_for_sub_slim_index[2, 0] = 1: the data's 3rd sub-pixel maps to the mesh's 2nd pixel. - - The second dimension of this array (where all three examples above are 0) is used for cases where a - single pixel on the `grid_slim` maps to multiple pixels on the `mesh_grid`. For example, a - `Delaunay` triangulation, where every `grid_slim` pixel maps to three Delaunay pixels (the corners of the - triangles) with varying interpolation weights . - - For a `Rectangular` mesh every pixel in the masked data maps to only one pixel, thus the second - dimension of `pix_indexes_for_sub_slim_index` is always of size 1. - - The mapper allows us to create a mapping matrix, which is a matrix representing the mapping between every - unmasked data pixel annd the pixels of a mesh. This matrix is the basis of performing an `Inversion`, - which reconstructs the data using the `source_plane_mesh_grid`. - - Parameters - ---------- - mapper_grids - An object containing the data grid and mesh grid in both the data-frame and source-frame used by the - mapper to map data-points to linear object parameters. - regularization - The regularization scheme which may be applied to this linear object in order to smooth its solution, - which for a mapper smooths neighboring pixels on the mesh. - relocate_pix_border - If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border - relocated to their edge. - run_time_dict - A dictionary which contains timing of certain functions calls which is used for profiling. + To understand a `Mapper` one must be familiar `Mesh` objects and the `mesh` and `pixelization` packages, where + the four grids grouped in a `MapperGrids` object are explained (`image_plane_data_grid`, `source_plane_data_grid`, + `image_plane_mesh_grid`,`source_plane_mesh_grid`) + + If you are unfamliar withe above objects, read through the docstrings of the `pixelization`, `mesh` and + `mapper_grids` packages. + + A `Mapper` determines the mappings between the masked data grid's pixels (`image_plane_data_grid` and + `source_plane_data_grid`) and the mesh's pixels (`image_plane_mesh_grid` and `source_plane_mesh_grid`). + + The 1D Indexing of each grid is identical in the `data` and `source` frames (e.g. the transformation does not + change the indexing, such that `source_plane_data_grid[0]` corresponds to the transformed value + of `image_plane_data_grid[0]` and so on). + + A mapper therefore only needs to determine the index mappings between the `grid_slim` and `mesh_grid`, + noting that associations are made by pairing `source_plane_mesh_grid` with `source_plane_data_grid`. + + Mappings are represented in the 2D ndarray `pix_indexes_for_sub_slim_index`, whereby the index of + a pixel on the `mesh_grid` maps to the index of a pixel on the `grid_slim` as follows: + + - pix_indexes_for_sub_slim_index[0, 0] = 0: the data's 1st sub-pixel maps to the mesh's 1st pixel. + - pix_indexes_for_sub_slim_index[1, 0] = 3: the data's 2nd sub-pixel maps to the mesh's 4th pixel. + - pix_indexes_for_sub_slim_index[2, 0] = 1: the data's 3rd sub-pixel maps to the mesh's 2nd pixel. + + The second dimension of this array (where all three examples above are 0) is used for cases where a + single pixel on the `grid_slim` maps to multiple pixels on the `mesh_grid`. For example, a + `Delaunay` triangulation, where every `grid_slim` pixel maps to three Delaunay pixels (the corners of the + triangles) with varying interpolation weights . + + For a `Rectangular` mesh every pixel in the masked data maps to only one pixel, thus the second + dimension of `pix_indexes_for_sub_slim_index` is always of size 1. + + The mapper allows us to create a mapping matrix, which is a matrix representing the mapping between every + unmasked data pixel annd the pixels of a mesh. This matrix is the basis of performing an `Inversion`, + which reconstructs the data using the `source_plane_mesh_grid`. + + Parameters + ---------- + mapper_grids + An object containing the data grid and mesh grid in both the data-frame and source-frame used by the + mapper to map data-points to linear object parameters. + regularization + The regularization scheme which may be applied to this linear object in order to smooth its solution, + which for a mapper smooths neighboring pixels on the mesh. + relocate_pix_border + If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border + relocated to their edge. + run_time_dict + A dictionary which contains timing of certain functions calls which is used for profiling. """ super().__init__( mapper_grids=mapper_grids, diff --git a/autoarray/inversion/pixelization/mesh/abstract.py b/autoarray/inversion/pixelization/mesh/abstract.py index f64c424b..273fc81d 100644 --- a/autoarray/inversion/pixelization/mesh/abstract.py +++ b/autoarray/inversion/pixelization/mesh/abstract.py @@ -18,33 +18,33 @@ def relocated_grid_from( self, source_plane_data_grid: Grid2D, preloads: Preloads = Preloads(), - relocate_pix_border : bool = False, + relocate_pix_border: bool = False, ) -> Grid2D: """ - Relocates all coordinates of the input `source_plane_data_grid` that are outside of a - border (which is defined by a grid of (y,x) coordinates) to the edge of this border. - - The border is determined from the mask of the 2D data in the `data` frame before any transformations of the - data's grid are performed. The border is all pixels in this mask that are pixels at its extreme edge. These - pixel indexes are used to then determine a grid of (y,x) coordinates from the transformed `source_grid_grid` in - the `source` reference frame, whereby points located outside of it are relocated to the border's edge. - - A full description of relocation is given in the method grid_2d.relocated_grid_from()`. - - This is used in the project PyAutoLens to relocate the coordinates that are ray-traced near the centre of mass - of galaxies, which are heavily demagnified and may trace to outskirts of the source-plane well beyond the - border. - - Parameters - ---------- - source_plane_data_grid - A 2D (y,x) grid of coordinates, whose coordinates outside the border are relocated to its edge. - preloads - Contains quantities which may already be computed and can be preloaded to speed up calculations, in this - case the relocated grid. - relocate_pix_border - If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border - relocated to their edge. + Relocates all coordinates of the input `source_plane_data_grid` that are outside of a + border (which is defined by a grid of (y,x) coordinates) to the edge of this border. + + The border is determined from the mask of the 2D data in the `data` frame before any transformations of the + data's grid are performed. The border is all pixels in this mask that are pixels at its extreme edge. These + pixel indexes are used to then determine a grid of (y,x) coordinates from the transformed `source_grid_grid` in + the `source` reference frame, whereby points located outside of it are relocated to the border's edge. + + A full description of relocation is given in the method grid_2d.relocated_grid_from()`. + + This is used in the project PyAutoLens to relocate the coordinates that are ray-traced near the centre of mass + of galaxies, which are heavily demagnified and may trace to outskirts of the source-plane well beyond the + border. + + Parameters + ---------- + source_plane_data_grid + A 2D (y,x) grid of coordinates, whose coordinates outside the border are relocated to its edge. + preloads + Contains quantities which may already be computed and can be preloaded to speed up calculations, in this + case the relocated grid. + relocate_pix_border + If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border + relocated to their edge. """ if preloads.relocated_grid is None: if relocate_pix_border: @@ -60,35 +60,35 @@ def relocated_mesh_grid_from( self, source_plane_data_grid: Grid2D, source_plane_mesh_grid: Grid2DIrregular, - relocate_pix_border : bool = False + relocate_pix_border: bool = False, ): """ - Relocates all coordinates of the input `source_plane_mesh_grid` that are outside of a border (which - is defined by a grid of (y,x) coordinates) to the edge of this border. - - The border is determined from the mask of the 2D data in the `data` frame before any transformations of the - data's grid are performed. The border is all pixels in this mask that are pixels at its extreme edge. These - pixel indexes are used to then determine a grid of (y,x) coordinates from the transformed `source_grid_grid` in - the `source` reference frame, whereby points located outside of it are relocated to the border's edge. - - A full description of relocation is given in the method grid_2d.relocated_grid_from()`. - - This is used in the project `PyAutoLens` to relocate the coordinates that are ray-traced near the centre of mass - of galaxies, which are heavily demagnified and may trace to outskirts of the source-plane well beyond the - border. - - Parameters - ---------- - source_plane_data_grid - A 2D grid of (y,x) coordinates associated with the unmasked 2D data after it has been transformed to the - `source` reference frame. - source_plane_mesh_grid - The centres of every Voronoi pixel in the `source` frame, which are initially derived by computing a sparse - set of (y,x) coordinates computed from the unmasked data in the `data` frame and applying a transformation - to this. - relocate_pix_border - If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border - relocated to their edge. + Relocates all coordinates of the input `source_plane_mesh_grid` that are outside of a border (which + is defined by a grid of (y,x) coordinates) to the edge of this border. + + The border is determined from the mask of the 2D data in the `data` frame before any transformations of the + data's grid are performed. The border is all pixels in this mask that are pixels at its extreme edge. These + pixel indexes are used to then determine a grid of (y,x) coordinates from the transformed `source_grid_grid` in + the `source` reference frame, whereby points located outside of it are relocated to the border's edge. + + A full description of relocation is given in the method grid_2d.relocated_grid_from()`. + + This is used in the project `PyAutoLens` to relocate the coordinates that are ray-traced near the centre of mass + of galaxies, which are heavily demagnified and may trace to outskirts of the source-plane well beyond the + border. + + Parameters + ---------- + source_plane_data_grid + A 2D grid of (y,x) coordinates associated with the unmasked 2D data after it has been transformed to the + `source` reference frame. + source_plane_mesh_grid + The centres of every Voronoi pixel in the `source` frame, which are initially derived by computing a sparse + set of (y,x) coordinates computed from the unmasked data in the `data` frame and applying a transformation + to this. + relocate_pix_border + If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border + relocated to their edge. """ if relocate_pix_border: return source_plane_data_grid.relocated_mesh_grid_from( diff --git a/autoarray/inversion/pixelization/mesh/rectangular.py b/autoarray/inversion/pixelization/mesh/rectangular.py index 361aab0a..a3a1d657 100644 --- a/autoarray/inversion/pixelization/mesh/rectangular.py +++ b/autoarray/inversion/pixelization/mesh/rectangular.py @@ -71,40 +71,40 @@ def mapper_grids_from( run_time_dict: Optional[Dict] = None, ) -> MapperGrids: """ - Mapper objects describe the mappings between pixels in the masked 2D data and the pixels in a pixelization, - in both the `data` and `source` frames. - - This function returns a `MapperRectangularNoInterp` as follows: - - 1) If `relocate_pix_border=True`, the border of the input `source_plane_data_grid` is used to relocate all of the - grid's (y,x) coordinates beyond the border to the edge of the border. - - 2) Determine the (y,x) coordinates of the pixelization's rectangular pixels, by laying this rectangular grid - over the 2D grid of relocated (y,x) coordinates computed in step 1 (or the input `source_plane_data_grid` if step 1 - is bypassed). - - 3) Return the `MapperRectangularNoInterp`. - - Parameters - ---------- - source_plane_data_grid - A 2D grid of (y,x) coordinates associated with the unmasked 2D data after it has been transformed to the - `source` reference frame. - source_plane_mesh_grid - Not used for a rectangular pixelization, because the pixelization grid in the `source` frame is computed - by overlaying the `source_plane_data_grid` with the rectangular pixelization. - image_plane_mesh_grid - Not used for a rectangular pixelization. - adapt_data - Not used for a rectangular pixelization. - relocate_pix_border - If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border - relocated to their edge. - preloads - Object which may contain preloaded arrays of quantities computed in the pixelization, which are passed via - this object speed up the calculation. - run_time_dict - A dictionary which contains timing of certain functions calls which is used for profiling. + Mapper objects describe the mappings between pixels in the masked 2D data and the pixels in a pixelization, + in both the `data` and `source` frames. + + This function returns a `MapperRectangularNoInterp` as follows: + + 1) If `relocate_pix_border=True`, the border of the input `source_plane_data_grid` is used to relocate all of the + grid's (y,x) coordinates beyond the border to the edge of the border. + + 2) Determine the (y,x) coordinates of the pixelization's rectangular pixels, by laying this rectangular grid + over the 2D grid of relocated (y,x) coordinates computed in step 1 (or the input `source_plane_data_grid` if step 1 + is bypassed). + + 3) Return the `MapperRectangularNoInterp`. + + Parameters + ---------- + source_plane_data_grid + A 2D grid of (y,x) coordinates associated with the unmasked 2D data after it has been transformed to the + `source` reference frame. + source_plane_mesh_grid + Not used for a rectangular pixelization, because the pixelization grid in the `source` frame is computed + by overlaying the `source_plane_data_grid` with the rectangular pixelization. + image_plane_mesh_grid + Not used for a rectangular pixelization. + adapt_data + Not used for a rectangular pixelization. + relocate_pix_border + If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border + relocated to their edge. + preloads + Object which may contain preloaded arrays of quantities computed in the pixelization, which are passed via + this object speed up the calculation. + run_time_dict + A dictionary which contains timing of certain functions calls which is used for profiling. """ self.run_time_dict = run_time_dict diff --git a/autoarray/inversion/pixelization/mesh/triangulation.py b/autoarray/inversion/pixelization/mesh/triangulation.py index e6f9192e..b7a4c059 100644 --- a/autoarray/inversion/pixelization/mesh/triangulation.py +++ b/autoarray/inversion/pixelization/mesh/triangulation.py @@ -20,50 +20,50 @@ def mapper_grids_from( run_time_dict: Optional[Dict] = None, ) -> MapperGrids: """ - Mapper objects describe the mappings between pixels in the masked 2D data and the pixels in a mesh, - in both the `data` and `source` frames. - - This function returns a `MapperVoronoiNoInterp` as follows: - - 1) Before this routine is called, a sparse grid of (y,x) coordinates are computed from the 2D masked data, - the `image_plane_mesh_grid`, which acts as the Voronoi pixel centres of the mesh and mapper. - - 2) Before this routine is called, operations are performed on this `image_plane_mesh_grid` that transform it - from a 2D grid which overlaps with the 2D mask of the data in the `data` frame to an irregular grid in - the `source` frame, the `source_plane_mesh_grid`. - - 3) If `relocate_pix_border=True`, the border of the input `source_plane_data_grid` is used to relocate all of the - grid's (y,x) coordinates beyond the border to the edge of the border. - - 4) If `relocate_pix_border=True`, the border of the input `source_plane_data_grid` is used to relocate all of the - transformed `source_plane_mesh_grid`'s (y,x) coordinates beyond the border to the edge of the border. - - 5) Use the transformed `source_plane_mesh_grid`'s (y,x) coordinates as the centres of the Voronoi mesh. - - 6) Return the `MapperVoronoiNoInterp`. - - Parameters - ---------- - source_plane_data_grid - A 2D grid of (y,x) coordinates associated with the unmasked 2D data after it has been transformed to the - `source` reference frame. - source_plane_mesh_grid - The centres of every Voronoi pixel in the `source` frame, which are initially derived by computing a sparse - set of (y,x) coordinates computed from the unmasked data in the `data` frame and applying a transformation - to this. - image_plane_mesh_grid - The sparse set of (y,x) coordinates computed from the unmasked data in the `data` frame. This has a - transformation applied to it to create the `source_plane_mesh_grid`. - adapt_data - Not used for a rectangular mesh. - relocate_pix_border - If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border - relocated to their edge. - preloads - Object which may contain preloaded arrays of quantities computed in the mesh, which are passed via - this object speed up the calculation. - run_time_dict - A dictionary which contains timing of certain functions calls which is used for profiling. + Mapper objects describe the mappings between pixels in the masked 2D data and the pixels in a mesh, + in both the `data` and `source` frames. + + This function returns a `MapperVoronoiNoInterp` as follows: + + 1) Before this routine is called, a sparse grid of (y,x) coordinates are computed from the 2D masked data, + the `image_plane_mesh_grid`, which acts as the Voronoi pixel centres of the mesh and mapper. + + 2) Before this routine is called, operations are performed on this `image_plane_mesh_grid` that transform it + from a 2D grid which overlaps with the 2D mask of the data in the `data` frame to an irregular grid in + the `source` frame, the `source_plane_mesh_grid`. + + 3) If `relocate_pix_border=True`, the border of the input `source_plane_data_grid` is used to relocate all of the + grid's (y,x) coordinates beyond the border to the edge of the border. + + 4) If `relocate_pix_border=True`, the border of the input `source_plane_data_grid` is used to relocate all of the + transformed `source_plane_mesh_grid`'s (y,x) coordinates beyond the border to the edge of the border. + + 5) Use the transformed `source_plane_mesh_grid`'s (y,x) coordinates as the centres of the Voronoi mesh. + + 6) Return the `MapperVoronoiNoInterp`. + + Parameters + ---------- + source_plane_data_grid + A 2D grid of (y,x) coordinates associated with the unmasked 2D data after it has been transformed to the + `source` reference frame. + source_plane_mesh_grid + The centres of every Voronoi pixel in the `source` frame, which are initially derived by computing a sparse + set of (y,x) coordinates computed from the unmasked data in the `data` frame and applying a transformation + to this. + image_plane_mesh_grid + The sparse set of (y,x) coordinates computed from the unmasked data in the `data` frame. This has a + transformation applied to it to create the `source_plane_mesh_grid`. + adapt_data + Not used for a rectangular mesh. + relocate_pix_border + If `True`, all coordinates of all pixelization source mesh grids have pixels outside their border + relocated to their edge. + preloads + Object which may contain preloaded arrays of quantities computed in the mesh, which are passed via + this object speed up the calculation. + run_time_dict + A dictionary which contains timing of certain functions calls which is used for profiling. """ self.run_time_dict = run_time_dict diff --git a/test_autoarray/inversion/pixelization/mesh/test_abstract.py b/test_autoarray/inversion/pixelization/mesh/test_abstract.py index 2c6275a3..ca7f0888 100644 --- a/test_autoarray/inversion/pixelization/mesh/test_abstract.py +++ b/test_autoarray/inversion/pixelization/mesh/test_abstract.py @@ -24,7 +24,7 @@ def test__grid_is_relocated_via_border(sub_grid_2d_7x7): mapper_grids = mesh.mapper_grids_from( source_plane_data_grid=grid, source_plane_mesh_grid=image_mesh, - relocate_pix_border=True + relocate_pix_border=True, ) mapper = aa.Mapper(mapper_grids=mapper_grids, regularization=None) diff --git a/test_autoarray/inversion/pixelization/mesh/test_triangulation.py b/test_autoarray/inversion/pixelization/mesh/test_triangulation.py index 999fa4e8..b213b96c 100644 --- a/test_autoarray/inversion/pixelization/mesh/test_triangulation.py +++ b/test_autoarray/inversion/pixelization/mesh/test_triangulation.py @@ -2,6 +2,7 @@ import autoarray as aa + def test___preloads_used_for_relocated_grid(sub_grid_2d_7x7): mesh = aa.mesh.Delaunay() @@ -14,4 +15,4 @@ def test___preloads_used_for_relocated_grid(sub_grid_2d_7x7): preloads=aa.Preloads(relocated_grid=relocated_grid), ) - assert mapper_grids.source_plane_data_grid == pytest.approx(relocated_grid, 1.0e-4) \ No newline at end of file + assert mapper_grids.source_plane_data_grid == pytest.approx(relocated_grid, 1.0e-4)