diff --git a/autogalaxy/__init__.py b/autogalaxy/__init__.py index 65a00fab6..6f677c9a7 100644 --- a/autogalaxy/__init__.py +++ b/autogalaxy/__init__.py @@ -10,22 +10,17 @@ from autoarray.dataset.imaging.dataset import Imaging # noqa from autoarray.dataset.interferometer.dataset import Interferometer # noqa from autoarray.dataset.dataset_model import DatasetModel -from autoarray.inversion.pixelization import mesh # noqa +from autoarray.inversion.mesh import mesh # noqa from autoarray.inversion import regularization as reg # noqa -from autoarray.inversion.pixelization import image_mesh -from autoarray.inversion.pixelization.mappers.abstract import AbstractMapper # noqa -from autoarray.inversion.inversion.settings import SettingsInversion # noqa +from autoarray.inversion.mesh import image_mesh +from autoarray.inversion.mappers.abstract import Mapper # noqa +from autoarray.settings import Settings # noqa from autoarray.inversion.inversion.factory import inversion_from as Inversion # noqa -from autoarray.inversion.pixelization.image_mesh.abstract import AbstractImageMesh -from autoarray.inversion.pixelization.mesh.abstract import AbstractMesh +from autoarray.inversion.mesh.image_mesh.abstract import AbstractImageMesh +from autoarray.inversion.mesh.mesh.abstract import AbstractMesh from autoarray.inversion.regularization.abstract import AbstractRegularization -from autoarray.inversion.pixelization.pixelization import Pixelization # noqa -from autoarray.inversion.pixelization.mappers.abstract import AbstractMapper -from autoarray.inversion.pixelization.mappers.mapper_grids import MapperGrids # noqa -from autoarray.inversion.pixelization.mappers.factory import ( - mapper_from as Mapper, -) # noqa -from autoarray.inversion.pixelization.border_relocator import BorderRelocator +from autoarray.inversion.pixelization import Pixelization # noqa +from autoarray.inversion.mesh.border_relocator import BorderRelocator from autoarray.preloads import Preloads from autoarray.preloads import mapper_indices_from from autoarray.mask.mask_1d import Mask1D # noqa @@ -43,11 +38,12 @@ from autoarray.structures.grids.uniform_2d import Grid2D # noqa from autoarray.structures.grids.irregular_2d import Grid2DIrregular # noqa from autoarray.operators.over_sampling.over_sampler import OverSampler # noqa -from autoarray.structures.mesh.rectangular_2d import Mesh2DRectangular # noqa -from autoarray.structures.mesh.rectangular_2d_uniform import ( - Mesh2DRectangularUniform, +from autoarray.inversion.mesh.interpolator.rectangular import ( + InterpolatorRectangular, +) # noqa +from autoarray.inversion.mesh.interpolator.delaunay import ( + InterpolatorDelaunay, ) # noqa -from autoarray.structures.mesh.delaunay_2d import Mesh2DDelaunay # noqa from autoarray.structures.vectors.uniform import VectorYX2D # noqa from autoarray.structures.vectors.irregular import VectorYX2DIrregular # noqa from autoarray.layout.region import Region1D # noqa @@ -55,6 +51,9 @@ from autoarray.structures.arrays.kernel_2d import Kernel2D # noqa from autoarray.structures.visibilities import Visibilities # noqa from autoarray.structures.visibilities import VisibilitiesNoiseMap # noqa +from autoarray.inversion.mesh.mesh_geometry.rectangular import ( + rectangular_edge_pixel_list_from, +) from .analysis import model_util from .analysis.adapt_images.adapt_images import AdaptImages diff --git a/autogalaxy/abstract_fit.py b/autogalaxy/abstract_fit.py index 5f7223592..a478a8dc5 100644 --- a/autogalaxy/abstract_fit.py +++ b/autogalaxy/abstract_fit.py @@ -15,7 +15,7 @@ class AbstractFitInversion: - def __init__(self, model_obj, settings_inversion: aa.SettingsInversion, xp=np): + def __init__(self, model_obj, settings: aa.Settings, xp=np): """ An abstract fit object which fits to datasets (e.g. imaging, interferometer) inherit from. @@ -28,11 +28,11 @@ def __init__(self, model_obj, settings_inversion: aa.SettingsInversion, xp=np): The object which contains the model components (e.g. light profiles, galaxies, etc) which are used to create the model-data that fits the data. In PyAutoGalaxy this is a list of galaxies and PyAutoLens it is a `Tracer`. - settings_inversion + settings Settings controlling how an inversion is fitted for example which linear algebra formalism is used. """ self.model_obj = model_obj - self.settings_inversion = settings_inversion + self.settings = settings or aa.Settings() self.use_jax = xp is not np @property @@ -75,7 +75,7 @@ def perform_inversion(self) -> bool: def sparse_operator(self) -> Optional[aa.ImagingSparseOperator]: """ Only call the `sparse_operator` property of a dataset used to perform efficient linear algebra calculations if - the SettingsInversion()` object has `use_sparse_operator=True`, to avoid unnecessary computation. + the Settings()` object has `use_sparse_operator=True`, to avoid unnecessary computation. Returns ------- diff --git a/autogalaxy/aggregator/ellipse/fit_ellipse.py b/autogalaxy/aggregator/ellipse/fit_ellipse.py index 3773bb914..7f1ca263c 100644 --- a/autogalaxy/aggregator/ellipse/fit_ellipse.py +++ b/autogalaxy/aggregator/ellipse/fit_ellipse.py @@ -33,7 +33,7 @@ def _fit_ellipse_from( is instead used to load lists of the data, noise-map, PSF and mask and combine them into a list of `FitEllipse` objects. - The settings of an inversion can be overwritten by inputting a `settings_inversion` object, for example + The settings of an inversion can be overwritten by inputting a `settings` object, for example if you want to use a grid with a different inversion solver. Parameters diff --git a/autogalaxy/aggregator/imaging/fit_imaging.py b/autogalaxy/aggregator/imaging/fit_imaging.py index ef22525a3..aac0dc26b 100644 --- a/autogalaxy/aggregator/imaging/fit_imaging.py +++ b/autogalaxy/aggregator/imaging/fit_imaging.py @@ -16,7 +16,7 @@ def _fit_imaging_from( fit: af.Fit, instance: Optional[af.ModelInstance] = None, - settings_inversion: aa.SettingsInversion = None, + settings: aa.Settings = None, ) -> List[FitImaging]: """ Returns a list of `FitImaging` objects from a `PyAutoFit` loaded directory `Fit` or sqlite database `Fit` object. @@ -26,7 +26,7 @@ def _fit_imaging_from( - The imaging data, noise-map, PSF and settings as .fits files (e.g. `dataset/data.fits`). - The mask used to mask the `Imaging` data structure in the fit (`dataset.fits[hdu=0]`). - - The settings of inversions used by the fit (`dataset/settings_inversion.json`). + - The settings of inversions used by the fit (`dataset/settings.json`). Each individual attribute can be loaded from the database via the `fit.value()` method. @@ -37,7 +37,7 @@ def _fit_imaging_from( is instead used to load lists of the data, noise-map, PSF and mask and combine them into a list of `FitImaging` objects. - The settings of an inversion can be overwritten by inputting a `settings_inversion` object, for example + The settings of an inversion can be overwritten by inputting a `settings` object, for example if you want to use a grid with a different inversion solver. Parameters @@ -48,8 +48,8 @@ def _fit_imaging_from( instance A manual instance that overwrites the max log likelihood instance in fit (e.g. for drawing the instance randomly from the PDF). - settings_inversion - Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. + settings + Optionally overwrite the `Settings` of the `Inversion` object that is created from the fit. """ from autogalaxy.imaging.fit_imaging import FitImaging @@ -62,7 +62,7 @@ def _fit_imaging_from( adapt_images_list = agg_util.adapt_images_from(fit=fit) - settings_inversion = settings_inversion or fit.value(name="settings_inversion") + settings = settings or fit.value(name="settings") fit_dataset_list = [] @@ -79,7 +79,7 @@ def _fit_imaging_from( galaxies=galaxies, dataset_model=dataset_model, adapt_images=adapt_images, - settings_inversion=settings_inversion, + settings=settings, ) ) @@ -90,7 +90,7 @@ class FitImagingAgg(af.AggBase): def __init__( self, aggregator: af.Aggregator, - settings_inversion: Optional[aa.SettingsInversion] = None, + settings: Optional[aa.Settings] = None, ): """ Interfaces with an `PyAutoFit` aggregator object to create instances of `FitImaging` objects from the results @@ -101,7 +101,7 @@ def __init__( - The imaging data, noise-map, PSF and settings as .fits files (e.g. `dataset/data.fits`). - The mask used to mask the `Imaging` data structure in the fit (`dataset.fits[hdu=0]`). - - The settings of inversions used by the fit (`dataset/settings_inversion.json`). + - The settings of inversions used by the fit (`dataset/settings.json`). The `aggregator` contains the path to each of these files, and they can be loaded individually. This class can load them all at once and create an `FitImaging` object via the `_fit_imaging_from` method. @@ -123,19 +123,19 @@ def __init__( ---------- aggregator A `PyAutoFit` aggregator object which can load the results of model-fits. - settings_inversion - Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. + settings + Optionally overwrite the `Settings` of the `Inversion` object that is created from the fit. Parameters ---------- aggregator A `PyAutoFit` aggregator object which can load the results of model-fits. - settings_inversion - Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. + settings + Optionally overwrite the `Settings` of the `Inversion` object that is created from the fit. """ super().__init__(aggregator=aggregator) - self.settings_inversion = settings_inversion + self.settings = settings def object_via_gen_from( self, fit, instance: Optional[af.ModelInstance] = None @@ -157,5 +157,5 @@ def object_via_gen_from( return _fit_imaging_from( fit=fit, instance=instance, - settings_inversion=self.settings_inversion, + settings=self.settings, ) diff --git a/autogalaxy/aggregator/interferometer/fit_interferometer.py b/autogalaxy/aggregator/interferometer/fit_interferometer.py index 4f4034c4b..69885be52 100644 --- a/autogalaxy/aggregator/interferometer/fit_interferometer.py +++ b/autogalaxy/aggregator/interferometer/fit_interferometer.py @@ -16,7 +16,7 @@ def _fit_interferometer_from( fit: af.Fit, instance: Optional[af.ModelInstance] = None, - settings_inversion: aa.SettingsInversion = None, + settings: aa.Settings = None, ) -> List[FitInterferometer]: """ Returns a list of `FitInterferometer` objects from a `PyAutoFit` loaded directory `Fit` or sqlite database `Fit` object. @@ -26,7 +26,7 @@ def _fit_interferometer_from( - The interferometer data, noise-map, uv-wavelengths and settings as .fits files (e.g. `dataset/data.fits`). - The real space mask defining the grid of the interferometer for the FFT (`dataset/real_space_mask.fits`). - - The settings of inversions used by the fit (`dataset/settings_inversion.json`). + - The settings of inversions used by the fit (`dataset/settings.json`). Each individual attribute can be loaded from the database via the `fit.value()` method. @@ -38,7 +38,7 @@ def _fit_interferometer_from( method is instead used to load lists of the data, noise-map, PSF and mask and combine them into a list of `FitInterferometer` objects. - The settings of an inversion can be overwritten by inputting a `settings_inversion` object, for + The settings of an inversion can be overwritten by inputting a `settings` object, for example if you want to use a grid with a different inversion solver. Parameters @@ -49,8 +49,8 @@ def _fit_interferometer_from( instance A manual instance that overwrites the max log likelihood instance in fit (e.g. for drawing the instance randomly from the PDF). - settings_inversion - Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. + settings + Optionally overwrite the `Settings` of the `Inversion` object that is created from the fit. """ from autogalaxy.interferometer.fit_interferometer import FitInterferometer @@ -64,7 +64,7 @@ def _fit_interferometer_from( adapt_images_list = agg_util.adapt_images_from(fit=fit) - settings_inversion = settings_inversion or fit.value(name="settings_inversion") + settings = settings or fit.value(name="settings") fit_dataset_list = [] @@ -81,7 +81,7 @@ def _fit_interferometer_from( galaxies=galaxies, dataset_model=dataset_model, adapt_images=adapt_images, - settings_inversion=settings_inversion, + settings=settings, ) ) @@ -92,7 +92,7 @@ class FitInterferometerAgg(af.AggBase): def __init__( self, aggregator: af.Aggregator, - settings_inversion: Optional[aa.SettingsInversion] = None, + settings: Optional[aa.Settings] = None, ): """ Interfaces with an `PyAutoFit` aggregator object to create instances of `FitInterferometer` objects from the @@ -103,7 +103,7 @@ def __init__( - The interferometer data, noise-map, uv-wavelengths and settings as .fits files (e.g. `dataset/data.fits`). - The real space mask defining the grid of the interferometer for the FFT (`dataset/real_space_mask.fits`). - - The settings of inversions used by the fit (`dataset/settings_inversion.json`). + - The settings of inversions used by the fit (`dataset/settings.json`). The `aggregator` contains the path to each of these files, and they can be loaded individually. This class can load them all at once and create an `FitInterferometer` object via the `_fit_interferometer_from` method. @@ -125,19 +125,19 @@ def __init__( ---------- aggregator A `PyAutoFit` aggregator object which can load the results of model-fits. - settings_inversion - Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. + settings + Optionally overwrite the `Settings` of the `Inversion` object that is created from the fit. Parameters ---------- aggregator A `PyAutoFit` aggregator object which can load the results of model-fits. - settings_inversion - Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. + settings + Optionally overwrite the `Settings` of the `Inversion` object that is created from the fit. """ super().__init__(aggregator=aggregator) - self.settings_inversion = settings_inversion + self.settings = settings def object_via_gen_from( self, fit, instance: Optional[af.ModelInstance] = None @@ -159,5 +159,5 @@ def object_via_gen_from( return _fit_interferometer_from( fit=fit, instance=instance, - settings_inversion=self.settings_inversion, + settings=self.settings, ) diff --git a/autogalaxy/analysis/analysis/dataset.py b/autogalaxy/analysis/analysis/dataset.py index f2ad68159..ee9843c2c 100644 --- a/autogalaxy/analysis/analysis/dataset.py +++ b/autogalaxy/analysis/analysis/dataset.py @@ -23,7 +23,7 @@ def __init__( dataset: Union[aa.Imaging, aa.Interferometer], adapt_images: Optional[AdaptImages] = None, cosmology: LensingCosmology = None, - settings_inversion: aa.SettingsInversion = None, + settings: aa.Settings = None, preloads: aa.Preloads = None, title_prefix: str = None, use_jax: bool = True, @@ -45,7 +45,7 @@ def __init__( used by certain classes for adapting the analysis to the properties of the dataset. cosmology The Cosmology assumed for this analysis. - settings_inversion + settings Settings controlling how an inversion is fitted during the model-fit, for example which linear algebra formalism is used. title_prefix @@ -62,7 +62,7 @@ def __init__( self.dataset = dataset self.adapt_images = adapt_images - self.settings_inversion = settings_inversion or aa.SettingsInversion() + self.settings = settings or aa.Settings() self.title_prefix = title_prefix @@ -138,8 +138,8 @@ def save_attributes(self, paths: af.DirectoryPaths): visualization, and the pickled objects used by the aggregator output by this function. """ paths.save_json( - name="settings_inversion", - object_dict=to_dict(self.settings_inversion), + name="settings", + object_dict=to_dict(self.settings), ) paths.save_json( name="cosmology", diff --git a/autogalaxy/analysis/plotter_interface.py b/autogalaxy/analysis/plotter_interface.py index ff6fdbe4b..f825b2091 100644 --- a/autogalaxy/analysis/plotter_interface.py +++ b/autogalaxy/analysis/plotter_interface.py @@ -214,7 +214,7 @@ def should_plot(name): ) if should_plot("subplot_inversion"): - mapper_list = inversion.cls_list_from(cls=aa.AbstractMapper) + mapper_list = inversion.cls_list_from(cls=aa.Mapper) for i in range(len(mapper_list)): suffix = "" if len(mapper_list) == 1 else f"_{i}" @@ -224,11 +224,11 @@ def should_plot(name): ) if should_plot("csv_reconstruction"): - mapper_list = inversion.cls_list_from(cls=aa.AbstractMapper) + mapper_list = inversion.cls_list_from(cls=aa.Mapper) for i, mapper in enumerate(mapper_list): - y = mapper.mapper_grids.source_plane_mesh_grid[:, 0] - x = mapper.mapper_grids.source_plane_mesh_grid[:, 1] + y = mapper.source_plane_mesh_grid[:, 0] + x = mapper.source_plane_mesh_grid[:, 1] reconstruction = inversion.reconstruction_dict[mapper] noise_map = inversion.reconstruction_noise_map_dict[mapper] diff --git a/autogalaxy/config/priors/mass/dark/cnfw_mcr_scatter.yaml b/autogalaxy/config/priors/mass/dark/cnfw_mcr_scatter.yaml index 907ca18aa..5cd63266a 100644 --- a/autogalaxy/config/priors/mass/dark/cnfw_mcr_scatter.yaml +++ b/autogalaxy/config/priors/mass/dark/cnfw_mcr_scatter.yaml @@ -59,7 +59,7 @@ cNFWMCRScatterLudlowSph: limits: lower: 0.0 upper: inf - scatter: + scatter_sigma: type: Gaussian mean: 0.0 sigma: 3.0 diff --git a/autogalaxy/config/priors/mass/dark/nfw_mcr_scatter.yaml b/autogalaxy/config/priors/mass/dark/nfw_mcr_scatter.yaml index d01feb8ff..01cd31a1e 100644 --- a/autogalaxy/config/priors/mass/dark/nfw_mcr_scatter.yaml +++ b/autogalaxy/config/priors/mass/dark/nfw_mcr_scatter.yaml @@ -49,7 +49,7 @@ NFWMCRScatterLudlowSph: limits: lower: 0.0 upper: inf - scatter: + scatter_sigma: type: Gaussian mean: 0.0 sigma: 3.0 diff --git a/autogalaxy/config/priors/mass/dark/nfw_truncated_mcr.yaml b/autogalaxy/config/priors/mass/dark/nfw_truncated_mcr.yaml index 13c1a813f..2eb3bb70d 100644 --- a/autogalaxy/config/priors/mass/dark/nfw_truncated_mcr.yaml +++ b/autogalaxy/config/priors/mass/dark/nfw_truncated_mcr.yaml @@ -151,7 +151,7 @@ NFWTruncatedMCRScatterLudlowSph: limits: lower: 0.0 upper: inf - scatter: + scatter_sigma: type: Gaussian mean: 0.0 sigma: 3.0 diff --git a/autogalaxy/config/priors/regularization/matern_adapt_kernel_rho.yaml b/autogalaxy/config/priors/regularization/matern_adapt_kernel_rho.yaml deleted file mode 100644 index 105ec87a1..000000000 --- a/autogalaxy/config/priors/regularization/matern_adapt_kernel_rho.yaml +++ /dev/null @@ -1,41 +0,0 @@ -MaternAdaptKernelRho: - coefficient: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - limits: - lower: 0.0 - upper: inf - scale: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.2 - limits: - lower: 0.0 - upper: inf - nu: - type: Uniform - lower_limit: 0.5 - upper_limit: 5.5 - width_modifier: - type: Relative - value: 0.2 - limits: - lower: 0.0 - upper: inf - rho: - type: Uniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.2 - limits: - lower: 0.0 - upper: inf \ No newline at end of file diff --git a/autogalaxy/convert.py b/autogalaxy/convert.py index fa0b12b91..641b12623 100644 --- a/autogalaxy/convert.py +++ b/autogalaxy/convert.py @@ -28,7 +28,6 @@ def ell_comps_from(axis_ratio: float, angle: float, xp=np) -> Tuple[float, float return (ellip_y, ellip_x) - def axis_ratio_and_angle_from( ell_comps: Tuple[float, float], xp=np ) -> Tuple[float, float]: @@ -61,7 +60,10 @@ def axis_ratio_and_angle_from( ell_comps The elliptical components of the light or mass profile which are converted to an angle. """ - angle = 0.5 * xp.arctan2(ell_comps[0], xp.where((ell_comps[0] == 0) & (ell_comps[1] == 0), 1.0, ell_comps[1])) + angle = 0.5 * xp.arctan2( + ell_comps[0], + xp.where((ell_comps[0] == 0) & (ell_comps[1] == 0), 1.0, ell_comps[1]), + ) angle *= 180.0 / xp.pi angle = xp.where(angle < -45, angle + 180, angle) @@ -198,7 +200,12 @@ def shear_magnitude_and_angle_from( gamma_2 The gamma 2 component of the shear. """ - angle = 0.5 * xp.arctan2(gamma_2, xp.where((gamma_1 == 0) & (gamma_2 == 0), 1.0, gamma_1)) * 180.0 / xp.pi + angle = ( + 0.5 + * xp.arctan2(gamma_2, xp.where((gamma_1 == 0) & (gamma_2 == 0), 1.0, gamma_1)) + * 180.0 + / xp.pi + ) magnitude = xp.sqrt(gamma_1**2 + gamma_2**2) angle = xp.where(angle < 0, angle + 180.0, angle) @@ -298,14 +305,19 @@ def multipole_k_m_and_phi_m_from( ------- The normalization and angle parameters of the multipole. """ - phi_m = xp.arctan2( - multipole_comps[0], - xp.where( - (multipole_comps[0] == 0) & (multipole_comps[1] == 0), - 1.0, - multipole_comps[1], - ), - ) * 180.0 / xp.pi / float(m) + phi_m = ( + xp.arctan2( + multipole_comps[0], + xp.where( + (multipole_comps[0] == 0) & (multipole_comps[1] == 0), + 1.0, + multipole_comps[1], + ), + ) + * 180.0 + / xp.pi + / float(m) + ) k_m = xp.sqrt(multipole_comps[1] ** 2 + multipole_comps[0] ** 2) diff --git a/autogalaxy/galaxy/to_inversion.py b/autogalaxy/galaxy/to_inversion.py index 82a0087c7..927ed4ef4 100644 --- a/autogalaxy/galaxy/to_inversion.py +++ b/autogalaxy/galaxy/to_inversion.py @@ -6,7 +6,6 @@ import autoarray as aa -from autoarray.inversion.pixelization.mappers.factory import mapper_from from autoarray.inversion.inversion.factory import inversion_from from autogalaxy.analysis.adapt_images.adapt_images import AdaptImages from autogalaxy.profiles.light.linear import ( @@ -23,7 +22,7 @@ def __init__( self, dataset: Optional[Union[aa.Imaging, aa.Interferometer, aa.DatasetInterface]], adapt_images: Optional[AdaptImages] = None, - settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), + settings: aa.Settings = None, preloads: aa.Preloads = None, xp=np, ): @@ -57,7 +56,7 @@ def __init__( adapt_images Images which certain pixelizations use to adapt their properties to the dataset, for example congregating the pixelization's pixels to the brightest regions of the image. - settings_inversion + settings The settings of the inversion, which controls how the linear algebra calculation is performed. """ if dataset is not None: @@ -76,7 +75,7 @@ def __init__( self.adapt_images = adapt_images - self.settings_inversion = settings_inversion + self.settings = settings or aa.Settings() self.preloads = preloads @@ -135,9 +134,9 @@ def border_relocator(self) -> Optional[aa.BorderRelocator]: A full description of the border relocator is given in the `BorderRelocator` class in PyAutoArray. - Border relocation is only used if the `use_border_relocator` attribute is True in the `SettingsInversion` object. + Border relocation is only used if the `use_border_relocator` attribute is True in the `Settings` object. """ - if self.settings_inversion.use_border_relocator: + if self.settings.use_border_relocator: return self.dataset.grids.border_relocator def cls_light_profile_func_list_galaxy_dict_from( @@ -158,7 +157,7 @@ def mapper_galaxy_dict(self): @cached_property def linear_obj_galaxy_dict( self, - ) -> Dict[Union[LightProfileLinearObjFuncList, aa.AbstractMapper], Galaxy]: + ) -> Dict[Union[LightProfileLinearObjFuncList, aa.Mapper], Galaxy]: """ Returns a dictionary associating every linear object (e.g. a linear light profile or mapper) with the galaxy it belongs to. @@ -202,7 +201,7 @@ def __init__( dataset: Optional[Union[aa.Imaging, aa.Interferometer, aa.DatasetInterface]], galaxies: List[Galaxy], adapt_images: Optional[AdaptImages] = None, - settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), + settings: aa.Settings = None, preloads: aa.Preloads = None, xp=np, ): @@ -237,7 +236,7 @@ def __init__( adapt_images Images which certain pixelizations use to adapt their properties to the dataset, for example congregating the pixelization's pixels to the brightest regions of the image. - settings_inversion + settings The settings of the inversion, which controls how the linear algebra calculation is performed. """ self.galaxies = Galaxies(galaxies) @@ -245,7 +244,7 @@ def __init__( super().__init__( dataset=dataset, adapt_images=adapt_images, - settings_inversion=settings_inversion, + settings=settings, preloads=preloads, xp=xp, ) @@ -323,7 +322,7 @@ def cls_light_profile_func_list_galaxy_dict_from( psf=self.dataset.psf, light_profile_list=light_profile_list, regularization=light_profile.regularization, - settings=self.settings_inversion, + settings=self.settings, xp=self._xp, ) @@ -430,7 +429,7 @@ def mapper_from( source_plane_data_grid: aa.Grid2D, adapt_galaxy_image: aa.Array2D, image_plane_mesh_grid: Optional[aa.Grid2DIrregular] = None, - ) -> aa.AbstractMapper: + ) -> aa.Mapper: """ Returns a `Mapper` object from the attributes required to create one, which are extracted and computed from the dataset and galaxies. @@ -473,27 +472,26 @@ def mapper_from( ------- A `Mapper` object which maps the dataset's data to the pixelization's mesh. """ - mapper_grids = mesh.mapper_grids_from( - mask=self.dataset.mask, + interpolator = mesh.interpolator_from( border_relocator=self.border_relocator, source_plane_data_grid=source_plane_data_grid, source_plane_mesh_grid=source_plane_mesh_grid, - image_plane_mesh_grid=image_plane_mesh_grid, adapt_data=adapt_galaxy_image, preloads=self.preloads, xp=self._xp, ) - return mapper_from( - mapper_grids=mapper_grids, + return aa.Mapper( + interpolator=interpolator, + image_plane_mesh_grid=image_plane_mesh_grid, regularization=regularization, - settings=self.settings_inversion, + settings=self.settings, preloads=self.preloads, xp=self._xp, ) @cached_property - def mapper_galaxy_dict(self) -> Dict[aa.AbstractMapper, Galaxy]: + def mapper_galaxy_dict(self) -> Dict[aa.Mapper, Galaxy]: """ Returns a dictionary associating each `Mapper` object with the galaxy it belongs to. @@ -570,7 +568,7 @@ def inversion(self) -> aa.AbstractInversion: inversion = inversion_from( dataset=self.dataset, linear_obj_list=self.linear_obj_list, - settings=self.settings_inversion, + settings=self.settings, preloads=self.preloads, xp=self._xp, ) diff --git a/autogalaxy/imaging/fit_imaging.py b/autogalaxy/imaging/fit_imaging.py index e4ea1bce7..997c723fc 100644 --- a/autogalaxy/imaging/fit_imaging.py +++ b/autogalaxy/imaging/fit_imaging.py @@ -24,7 +24,7 @@ def __init__( galaxies: List[Galaxy], dataset_model: Optional[aa.DatasetModel] = None, adapt_images: Optional[AdaptImages] = None, - settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), + settings: aa.Settings = None, preloads: aa.Preloads = None, xp=np, ): @@ -63,7 +63,7 @@ def __init__( adapt_images Contains the adapt-images which are used to make a pixelization's mesh and regularization adapt to the reconstructed galaxy's morphology. - settings_inversion + settings Settings controlling how an inversion is fitted for example which linear algebra formalism is used. """ @@ -77,12 +77,12 @@ def __init__( AbstractFitInversion.__init__( self=self, model_obj=self.galaxies, - settings_inversion=settings_inversion, + settings=settings, xp=xp, ) self.adapt_images = adapt_images - self.settings_inversion = settings_inversion + self.settings = settings or aa.Settings() self.preloads = preloads @@ -131,7 +131,7 @@ def galaxies_to_inversion(self) -> GalaxiesToInversion: dataset=dataset, galaxies=self.galaxies, adapt_images=self.adapt_images, - settings_inversion=self.settings_inversion, + settings=self.settings, preloads=self.preloads, xp=self._xp, ) diff --git a/autogalaxy/imaging/model/analysis.py b/autogalaxy/imaging/model/analysis.py index 2d1e6fabd..b95ef3f5b 100644 --- a/autogalaxy/imaging/model/analysis.py +++ b/autogalaxy/imaging/model/analysis.py @@ -21,7 +21,7 @@ def __init__( dataset: aa.Imaging, adapt_images: Optional[AdaptImages] = None, cosmology: LensingCosmology = None, - settings_inversion: aa.SettingsInversion = None, + settings: aa.Settings = None, preloads: aa.Preloads = None, title_prefix: str = None, use_jax: bool = True, @@ -50,7 +50,7 @@ def __init__( used by certain classes for adapting the analysis to the properties of the dataset. cosmology The Cosmology assumed for this analysis. - settings_inversion + settings Settings controlling how an inversion is fitted for example which linear algebra formalism is used. title_prefix A string that is added before the title of all figures output by visualization, for example to @@ -60,7 +60,7 @@ def __init__( dataset=dataset, adapt_images=adapt_images, cosmology=cosmology, - settings_inversion=settings_inversion, + settings=settings, preloads=preloads, title_prefix=title_prefix, use_jax=use_jax, @@ -143,7 +143,7 @@ def fit_from(self, instance: af.ModelInstance) -> FitImaging: galaxies=galaxies, dataset_model=dataset_model, adapt_images=adapt_images, - settings_inversion=self.settings_inversion, + settings=self.settings, preloads=self.preloads, xp=self._xp, ) diff --git a/autogalaxy/interferometer/fit_interferometer.py b/autogalaxy/interferometer/fit_interferometer.py index 72b4e0f05..e64ef0a74 100644 --- a/autogalaxy/interferometer/fit_interferometer.py +++ b/autogalaxy/interferometer/fit_interferometer.py @@ -19,7 +19,7 @@ def __init__( galaxies: List[Galaxy], dataset_model: Optional[aa.DatasetModel] = None, adapt_images: Optional[AdaptImages] = None, - settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), + settings: aa.Settings = None, preloads: aa.Preloads = None, xp=np, ): @@ -59,7 +59,7 @@ def __init__( adapt_images Contains the adapt-images which are used to make a pixelization's mesh and regularization adapt to the reconstructed galaxy's morphology. - settings_inversion + settings Settings controlling how an inversion is fitted for example which linear algebra formalism is used. """ @@ -71,12 +71,12 @@ def __init__( AbstractFitInversion.__init__( self=self, model_obj=self.galaxies, - settings_inversion=settings_inversion, + settings=settings, xp=xp, ) self.adapt_images = adapt_images - self.settings_inversion = settings_inversion + self.settings = settings or aa.Settings() self.preloads = preloads @@ -111,7 +111,7 @@ def galaxies_to_inversion(self) -> GalaxiesToInversion: dataset=dataset, galaxies=self.galaxies, adapt_images=self.adapt_images, - settings_inversion=self.settings_inversion, + settings=self.settings, preloads=self.preloads, xp=self._xp, ) diff --git a/autogalaxy/interferometer/model/analysis.py b/autogalaxy/interferometer/model/analysis.py index 010ffae83..61571ee33 100644 --- a/autogalaxy/interferometer/model/analysis.py +++ b/autogalaxy/interferometer/model/analysis.py @@ -28,7 +28,7 @@ def __init__( dataset: aa.Interferometer, adapt_images: Optional[AdaptImages] = None, cosmology: LensingCosmology = None, - settings_inversion: aa.SettingsInversion = None, + settings: aa.Settings = None, preloads: aa.Preloads = None, title_prefix: str = None, use_jax: bool = True, @@ -57,7 +57,7 @@ def __init__( used by certain classes for adapting the analysis to the properties of the dataset. cosmology The Cosmology assumed for this analysis. - settings_inversion + settings Settings controlling how an inversion is fitted, for example which linear algebra formalism is used. title_prefix A string that is added before the title of all figures output by visualization, for example to @@ -67,7 +67,7 @@ def __init__( dataset=dataset, adapt_images=adapt_images, cosmology=cosmology, - settings_inversion=settings_inversion, + settings=settings, preloads=preloads, title_prefix=title_prefix, use_jax=use_jax, @@ -145,7 +145,7 @@ def fit_from(self, instance: af.ModelInstance) -> FitInterferometer: dataset=self.dataset, galaxies=galaxies, adapt_images=adapt_images, - settings_inversion=self.settings_inversion, + settings=self.settings, preloads=self.preloads, xp=self._xp, ) diff --git a/autogalaxy/profiles/geometry_profiles.py b/autogalaxy/profiles/geometry_profiles.py index 920247bdf..963ed955d 100644 --- a/autogalaxy/profiles/geometry_profiles.py +++ b/autogalaxy/profiles/geometry_profiles.py @@ -106,7 +106,9 @@ def _cartesian_grid_via_radial_from( """ grid_angles = xp.arctan2(grid.array[:, 0], grid.array[:, 1]) - cos_theta, sin_theta = self.angle_to_profile_grid_from(grid_angles=grid_angles, xp=xp, **kwargs) + cos_theta, sin_theta = self.angle_to_profile_grid_from( + grid_angles=grid_angles, xp=xp, **kwargs + ) return xp.multiply(radius[:, None], xp.vstack((sin_theta, cos_theta)).T) diff --git a/autogalaxy/profiles/light/linear/abstract.py b/autogalaxy/profiles/light/linear/abstract.py index 5bb3f4c01..26eccf333 100644 --- a/autogalaxy/profiles/light/linear/abstract.py +++ b/autogalaxy/profiles/light/linear/abstract.py @@ -145,7 +145,7 @@ def __init__( psf: Optional[aa.Kernel2D], light_profile_list: List[LightProfileLinear], regularization=Optional[aa.reg.Regularization], - settings=aa.SettingsInversion(), + settings=aa.Settings(), xp=np, ): """ diff --git a/autogalaxy/profiles/mass/dark/cnfw.py b/autogalaxy/profiles/mass/dark/cnfw.py index 1dd868b22..5037038d7 100644 --- a/autogalaxy/profiles/mass/dark/cnfw.py +++ b/autogalaxy/profiles/mass/dark/cnfw.py @@ -164,4 +164,4 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): Lensing potential for the cored NFW profile. This is not yet implemented for `cNFWSph`. """ - return xp.zeros(shape=grid.shape[0]) \ No newline at end of file + return xp.zeros(shape=grid.shape[0]) diff --git a/autogalaxy/profiles/mass/dark/cnfw_mcr_scatter.py b/autogalaxy/profiles/mass/dark/cnfw_mcr_scatter.py index 14b1a75f3..84122ebb7 100644 --- a/autogalaxy/profiles/mass/dark/cnfw_mcr_scatter.py +++ b/autogalaxy/profiles/mass/dark/cnfw_mcr_scatter.py @@ -39,4 +39,4 @@ def __init__( kappa_s=kappa_s, scale_radius=scale_radius, core_radius=core_radius, - ) \ No newline at end of file + ) diff --git a/autogalaxy/profiles/mass/dark/nfw.py b/autogalaxy/profiles/mass/dark/nfw.py index 01e8c8c30..69c089a5d 100644 --- a/autogalaxy/profiles/mass/dark/nfw.py +++ b/autogalaxy/profiles/mass/dark/nfw.py @@ -48,7 +48,7 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform def deflections_2d_via_analytic_from( - self, grid: aa.type.Grid2DLike, xp=np, **kwargs + self, grid: aa.type.Grid2DLike, xp=np, **kwargs ): """ Analytic calculation deflection angles from Heyrovský & Karamazov 2024 via Eq. 30 & 31 @@ -70,28 +70,37 @@ def deflections_2d_via_analytic_from( x1 = grid.array[:, 1] / self.scale_radius x2 = grid.array[:, 0] / self.scale_radius - r2 = x1 ** 2 + x2 ** 2 + r2 = x1**2 + x2**2 # Avoid nans mask = r2 > 1e-24 - prefactor = xp.where(mask, 4 * self.kappa_s * xp.sqrt(1 - e_hk24 ** 2) / ( - ((x1 - e_hk24) ** 2 + x2 ** 2) * ((x1 + e_hk24) ** 2 + x2 ** 2) - ), 0.0) + prefactor = xp.where( + mask, + 4 + * self.kappa_s + * xp.sqrt(1 - e_hk24**2) + / (((x1 - e_hk24) ** 2 + x2**2) * ((x1 + e_hk24) ** 2 + x2**2)), + 0.0, + ) f1 = xp.where(mask, nfw_hk24_util.small_f_1(x1, x2, e_hk24, xp=xp), 0.0) f2 = xp.where(mask, nfw_hk24_util.small_f_2(x1, x2, e_hk24, xp=xp), 0.0) f3 = xp.where(mask, nfw_hk24_util.small_f_3(x1, x2, e_hk24, xp=xp), 0.0) - deflection_x = (x1 * ((x1**2 - e_hk24**2) * (1 - e_hk24**2) + x2**2 * (1 + e_hk24**2)) * f1 - + x1 * (x1**2 + x2**2 - e_hk24**2) * f2 - - x2 * (x1**2 + x2**2 + e_hk24**2) * f3) + deflection_x = ( + x1 * ((x1**2 - e_hk24**2) * (1 - e_hk24**2) + x2**2 * (1 + e_hk24**2)) * f1 + + x1 * (x1**2 + x2**2 - e_hk24**2) * f2 + - x2 * (x1**2 + x2**2 + e_hk24**2) * f3 + ) deflection_x *= prefactor - deflection_y = (x2 * (x1**2 * (1 - 2 * e_hk24**2) + x2**2 + e_hk24**2) * f1 - + x2 * (x1**2 + x2**2 + e_hk24**2) * f2 - + x1 * (x1**2 + x2**2 - e_hk24**2) * f3) + deflection_y = ( + x2 * (x1**2 * (1 - 2 * e_hk24**2) + x2**2 + e_hk24**2) * f1 + + x2 * (x1**2 + x2**2 + e_hk24**2) * f2 + + x1 * (x1**2 + x2**2 - e_hk24**2) * f3 + ) deflection_y *= prefactor return self.rotated_grid_from_reference_frame_from( @@ -199,9 +208,7 @@ def convergence_2d_via_cse_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs) def convergence_func(self, grid_radius: float) -> float: grid_radius = (1.0 / self.scale_radius) * grid_radius.array + 0j return np.real( - 2.0 - * self.kappa_s - * np.array(self.coord_func_g(grid_radius=grid_radius)) + 2.0 * self.kappa_s * np.array(self.coord_func_g(grid_radius=grid_radius)) ) @aa.over_sample @@ -340,7 +347,9 @@ def shear_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): # Calculate shear from nfw_HK24.py - g1, g2 = nfw_hk24_util.g1_g2_from(x1=x1, x2=x2, e=e_hk24, k_s=self.kappa_s, xp=xp) + g1, g2 = nfw_hk24_util.g1_g2_from( + x1=x1, x2=x2, e=e_hk24, k_s=self.kappa_s, xp=xp + ) # Rotation for shear diff --git a/autogalaxy/profiles/mass/dark/nfw_hk24_util.py b/autogalaxy/profiles/mass/dark/nfw_hk24_util.py index 667240baa..b75921bd6 100644 --- a/autogalaxy/profiles/mass/dark/nfw_hk24_util.py +++ b/autogalaxy/profiles/mass/dark/nfw_hk24_util.py @@ -42,12 +42,12 @@ def capital_F_from(chi, xp=np): less = chi < 1 - eps greater = chi > 1 + eps - root_min_arg = xp.where(less, 1 - chi ** 2, 0.0) + root_min_arg = xp.where(less, 1 - chi**2, 0.0) root_min = xp.sqrt(root_min_arg) root_min_safe = xp.where(less, root_min, 1.0) F_less = xp.where(less, xp.arctanh(root_min) / root_min_safe, 0.0) - root_plus_arg = xp.where(greater, chi ** 2 - 1, 0.0) + root_plus_arg = xp.where(greater, chi**2 - 1, 0.0) root_plus = xp.sqrt(root_plus_arg) root_plus_safe = xp.where(greater, root_plus, 1.0) F_greater = xp.where(greater, xp.arctan(root_plus) / root_plus_safe, 0.0) @@ -73,7 +73,7 @@ def kappa_from(k_s, a, xp=np): Convergence as a function of a """ F = capital_F_from(a, xp=xp) - kappa = xp.where(xp.abs(a - 1) < 1e-12, 2/3 * k_s, 2 * k_s * (1 - F) / (a**2 - 1)) + kappa = xp.where(xp.abs(a - 1) < 1e-12, 2 / 3 * k_s, 2 * k_s * (1 - F) / (a**2 - 1)) return kappa diff --git a/autogalaxy/util/__init__.py b/autogalaxy/util/__init__.py index 07b85cd91..32b7b7fa1 100644 --- a/autogalaxy/util/__init__.py +++ b/autogalaxy/util/__init__.py @@ -8,8 +8,7 @@ from autoarray.structures.grids import grid_2d_util as grid_2d from autoarray.structures.grids import sparse_2d_util as sparse from autoarray.fit import fit_util as fit -from autoarray.inversion.pixelization.mesh import mesh_util as mesh -from autoarray.inversion.pixelization.mappers import mapper_util as mapper +from autoarray.inversion.mappers import mapper_util as mapper from autoarray.inversion.regularization import regularization_util as regularization from autoarray.inversion.inversion import inversion_util as inversion from autoarray.inversion.inversion.imaging import ( diff --git a/docs/api/pixelization.rst b/docs/api/pixelization.rst index a34e73960..89be6265d 100644 --- a/docs/api/pixelization.rst +++ b/docs/api/pixelization.rst @@ -78,7 +78,7 @@ Settings :template: custom-class-template.rst :recursive: - SettingsInversion + Settings Mapper ------ diff --git a/test_autogalaxy/config/general.yaml b/test_autogalaxy/config/general.yaml index c67a01ed9..4643a809f 100644 --- a/test_autogalaxy/config/general.yaml +++ b/test_autogalaxy/config/general.yaml @@ -8,7 +8,6 @@ inversion: check_reconstruction: false # If True, the inversion's reconstruction is checked to ensure the solution of a meshs's mapper is not an invalid solution where the values are all the same. use_positive_only_solver: false # If True, inversion's use a positive-only linear algebra solver by default, which is slower but prevents unphysical negative values in the reconstructed solutuion. no_regularization_add_to_curvature_diag_value: 1.0e-8 # The default value added to the curvature matrix's diagonal when regularization is not applied to a linear object, which prevents inversion's failing due to the matrix being singular. - positive_only_uses_p_initial: false # If True, the positive-only solver of an inversion's uses an initial guess of the reconstructed data's values as which values should be positive, speeding up the solver. use_border_relocator: false # If True, by default a pixelization's border is used to relocate all pixels outside its border to the border. updates: iterations_per_quick_update: 1e99 # Non-linear search iterations between every quick update, which just displays the maximum likelihood model fit. diff --git a/test_autogalaxy/galaxy/test_galaxies.py b/test_autogalaxy/galaxy/test_galaxies.py index ea16d74ab..119655458 100644 --- a/test_autogalaxy/galaxy/test_galaxies.py +++ b/test_autogalaxy/galaxy/test_galaxies.py @@ -4,7 +4,7 @@ import autogalaxy as ag -from autoarray.inversion.pixelization.mesh.abstract import AbstractMesh +from autoarray.inversion.mesh.mesh.abstract import AbstractMesh from autoarray.inversion.regularization.abstract import AbstractRegularization from autogalaxy.galaxy.galaxies import plane_image_from diff --git a/test_autogalaxy/interferometer/test_fit_interferometer.py b/test_autogalaxy/interferometer/test_fit_interferometer.py index 4dcb55648..e10d07529 100644 --- a/test_autogalaxy/interferometer/test_fit_interferometer.py +++ b/test_autogalaxy/interferometer/test_fit_interferometer.py @@ -146,9 +146,10 @@ def test___galaxy_image_dict(interferometer_7): assert fit.galaxy_image_dict[g0_linear][4] == pytest.approx(0.9876689631, 1.0e-4) # Pixelization + Regularizaiton only + mesh = ag.mesh.RectangularUniform(shape=(3, 3)) pixelization = ag.Pixelization( - mesh=ag.mesh.RectangularUniform(shape=(3, 3)), + mesh=mesh, regularization=ag.reg.Constant(coefficient=1.0), ) @@ -158,19 +159,17 @@ def test___galaxy_image_dict(interferometer_7): fit = ag.FitInterferometer( dataset=interferometer_7, galaxies=[g0, galaxy_pix_0], - settings_inversion=ag.SettingsInversion(use_border_relocator=True), + settings=ag.Settings(use_border_relocator=True), ) - mapper_grids = pixelization.mesh.mapper_grids_from( - mask=interferometer_7.real_space_mask, + interpolator = mesh.interpolator_from( source_plane_data_grid=interferometer_7.grids.lp, border_relocator=interferometer_7.grids.border_relocator, source_plane_mesh_grid=None, ) mapper = ag.Mapper( - mapper_grids=mapper_grids, - border_relocator=interferometer_7.grids.border_relocator, + interpolator=interpolator, regularization=pixelization.regularization, ) @@ -263,8 +262,10 @@ def test___galaxy_model_visibilities_dict(interferometer_7): # Pixelization + Regularizaiton only + mesh = ag.mesh.RectangularUniform(shape=(3, 3)) + pixelization = ag.Pixelization( - mesh=ag.mesh.RectangularUniform(shape=(3, 3)), + mesh=mesh, regularization=ag.reg.Constant(coefficient=1.0), ) @@ -274,19 +275,17 @@ def test___galaxy_model_visibilities_dict(interferometer_7): fit = ag.FitInterferometer( dataset=interferometer_7, galaxies=[g0, galaxy_pix_0], - settings_inversion=ag.SettingsInversion(use_border_relocator=True), + settings=ag.Settings(use_border_relocator=True), ) - mapper_grids = pixelization.mesh.mapper_grids_from( - mask=interferometer_7.real_space_mask, + interpolator = mesh.interpolator_from( source_plane_data_grid=interferometer_7.grids.lp, border_relocator=interferometer_7.grids.border_relocator, source_plane_mesh_grid=None, ) mapper = ag.Mapper( - mapper_grids=mapper_grids, - border_relocator=interferometer_7.grids.border_relocator, + interpolator=interpolator, regularization=pixelization.regularization, ) diff --git a/test_autogalaxy/interferometer/test_simulate_and_fit_interferometer.py b/test_autogalaxy/interferometer/test_simulate_and_fit_interferometer.py index d4b178cc4..c8e1752b3 100644 --- a/test_autogalaxy/interferometer/test_simulate_and_fit_interferometer.py +++ b/test_autogalaxy/interferometer/test_simulate_and_fit_interferometer.py @@ -186,9 +186,7 @@ def test__linear_light_profiles_agree_with_standard_light_profiles(): fit_linear = ag.FitInterferometer( dataset=dataset, galaxies=[galaxy_linear], - settings_inversion=ag.SettingsInversion( - no_regularization_add_to_curvature_diag_value=False - ), + settings=ag.Settings(no_regularization_add_to_curvature_diag_value=False), ) assert fit_linear.inversion.reconstruction == pytest.approx( diff --git a/test_autogalaxy/profiles/mass/dark/test_nfw.py b/test_autogalaxy/profiles/mass/dark/test_nfw.py index 2fc4d4a06..fc1a16bb5 100644 --- a/test_autogalaxy/profiles/mass/dark/test_nfw.py +++ b/test_autogalaxy/profiles/mass/dark/test_nfw.py @@ -5,6 +5,7 @@ grid = ag.Grid2DIrregular([[1.0, 1.0], [2.0, 2.0], [3.0, 3.0], [2.0, 4.0]]) + def test__deflections_via_analytical_from(): nfw = ag.mp.NFW( diff --git a/test_autogalaxy/test_regression.py b/test_autogalaxy/test_regression.py index 9017db4b0..d83e8a43d 100644 --- a/test_autogalaxy/test_regression.py +++ b/test_autogalaxy/test_regression.py @@ -8,10 +8,8 @@ class FitInversion(AbstractFitInversion): - def __init__( - self, model_obj, settings_inversion: aa.SettingsInversion, light_profiles - ): - super().__init__(model_obj=model_obj, settings_inversion=settings_inversion) + def __init__(self, model_obj, settings: aa.Settings, light_profiles): + super().__init__(model_obj=model_obj, settings=settings) self.light_profiles = light_profiles @property @@ -41,7 +39,7 @@ def test_no_modify_state(light_profile): fit_inversion = FitInversion( model_obj=model_obj, light_profiles=[light_profile], - settings_inversion=aa.SettingsInversion(), + settings=aa.Settings(), ) result = fit_inversion.model_obj_linear_light_profiles_to_light_profiles