From e9afeefe34c2ef71cc047fe53122b70f55718d66 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Mon, 13 Apr 2026 21:19:23 +0100 Subject: [PATCH] refactor: rename aa.grid_dec to aa.decorators Mechanical rename of all aa.grid_dec. references to aa.decorators. across all profile and galaxy files. The old alias still works but is deprecated. Co-Authored-By: Claude Opus 4.6 --- autogalaxy/galaxy/galaxies.py | 10 +++--- autogalaxy/galaxy/galaxy.py | 10 +++--- autogalaxy/galaxy/mock/mock_galaxy.py | 8 ++--- autogalaxy/profiles/geometry_profiles.py | 18 +++++------ .../profiles/light/mock/mock_light_profile.py | 2 +- .../profiles/light/standard/chameleon.py | 4 +-- autogalaxy/profiles/light/standard/eff.py | 4 +-- .../profiles/light/standard/gaussian.py | 4 +-- autogalaxy/profiles/light/standard/moffat.py | 4 +-- autogalaxy/profiles/light/standard/sersic.py | 4 +-- .../light/standard/shapelets/cartesian.py | 4 +-- .../light/standard/shapelets/exponential.py | 4 +-- .../light/standard/shapelets/polar.py | 4 +-- autogalaxy/profiles/mass/abstract/mge.py | 8 ++--- autogalaxy/profiles/mass/dark/abstract.py | 4 +-- autogalaxy/profiles/mass/dark/cnfw.py | 12 +++---- autogalaxy/profiles/mass/dark/nfw.py | 28 ++++++++-------- .../profiles/mass/dark/nfw_truncated.py | 6 ++-- autogalaxy/profiles/mass/point/point.py | 6 ++-- .../profiles/mass/sheets/external_shear.py | 8 ++--- autogalaxy/profiles/mass/sheets/mass_sheet.py | 8 ++--- autogalaxy/profiles/mass/stellar/chameleon.py | 10 +++--- autogalaxy/profiles/mass/stellar/gaussian.py | 10 +++--- autogalaxy/profiles/mass/stellar/sersic.py | 14 ++++---- .../profiles/mass/stellar/sersic_gradient.py | 4 +-- .../mass/total/dual_pseudo_isothermal_mass.py | 32 +++++++++---------- .../total/dual_pseudo_isothermal_potential.py | 20 ++++++------ autogalaxy/profiles/mass/total/isothermal.py | 16 +++++----- autogalaxy/profiles/mass/total/power_law.py | 10 +++--- .../profiles/mass/total/power_law_broken.py | 10 +++--- .../profiles/mass/total/power_law_core.py | 16 +++++----- .../mass/total/power_law_multipole.py | 10 +++--- .../mass/test_transform_rotate_back.py | 2 +- 33 files changed, 157 insertions(+), 157 deletions(-) diff --git a/autogalaxy/galaxy/galaxies.py b/autogalaxy/galaxy/galaxies.py index 27b3e81d5..ffb9dbd34 100644 --- a/autogalaxy/galaxy/galaxies.py +++ b/autogalaxy/galaxy/galaxies.py @@ -109,7 +109,7 @@ def image_2d_list_from( for galaxy in self ] - @aa.grid_dec.to_array + @aa.decorators.to_array def image_2d_from( self, grid: aa.type.Grid2DLike, xp=np, operated_only: Optional[bool] = None ) -> aa.Array2D: @@ -175,7 +175,7 @@ def galaxy_image_2d_dict_from( return galaxy_image_2d_dict - @aa.grid_dec.to_vector_yx + @aa.decorators.to_vector_yx def deflections_yx_2d_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: @@ -201,7 +201,7 @@ def deflections_yx_2d_from( """ return sum(map(lambda g: g.deflections_yx_2d_from(grid=grid, xp=xp), self)) - @aa.grid_dec.to_grid + @aa.decorators.to_grid def traced_grid_2d_from( self, grid: aa.type.Grid2DLike, xp=np ) -> aa.type.Grid2DLike: @@ -210,7 +210,7 @@ def traced_grid_2d_from( """ return grid - self.deflections_yx_2d_from(grid=grid, xp=xp) - @aa.grid_dec.to_array + @aa.decorators.to_array def convergence_2d_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: @@ -236,7 +236,7 @@ def convergence_2d_from( """ return sum(map(lambda g: g.convergence_2d_from(grid=grid, xp=xp), self)) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/galaxy/galaxy.py b/autogalaxy/galaxy/galaxy.py index 38f66e5d9..b88410de1 100644 --- a/autogalaxy/galaxy/galaxy.py +++ b/autogalaxy/galaxy/galaxy.py @@ -210,7 +210,7 @@ def image_2d_list_from( ) ] - @aa.grid_dec.to_array + @aa.decorators.to_array def image_2d_from( self, grid: aa.type.Grid2DLike, @@ -246,7 +246,7 @@ def image_2d_from( ) return xp.zeros((grid.shape[0],)) - @aa.grid_dec.to_vector_yx + @aa.decorators.to_vector_yx def deflections_yx_2d_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: @@ -277,7 +277,7 @@ def deflections_yx_2d_from( return xp.zeros((grid.shape[0], 2)) - @aa.grid_dec.to_array + @aa.decorators.to_array def convergence_2d_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: @@ -318,7 +318,7 @@ def half_light_radius(self): """ return None - @aa.grid_dec.to_grid + @aa.decorators.to_grid def traced_grid_2d_from( self, grid: aa.type.Grid2DLike, xp=np ) -> aa.type.Grid2DLike: @@ -355,7 +355,7 @@ def traced_grid_2d_from( return grid - self.deflections_yx_2d_from(grid=grid, xp=xp) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/galaxy/mock/mock_galaxy.py b/autogalaxy/galaxy/mock/mock_galaxy.py index 423c4ebdd..3b8bcc389 100644 --- a/autogalaxy/galaxy/mock/mock_galaxy.py +++ b/autogalaxy/galaxy/mock/mock_galaxy.py @@ -8,18 +8,18 @@ def __init__(self, value, shape=1): self.value = value self.shape = shape - @aa.grid_dec.to_array + @aa.decorators.to_array def image_2d_from(self, grid): return np.full(shape=self.shape, fill_value=self.value) - @aa.grid_dec.to_array + @aa.decorators.to_array def convergence_2d_from(self, grid): return np.full(shape=self.shape, fill_value=self.value) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid): return np.full(shape=self.shape, fill_value=self.value) - @aa.grid_dec.to_vector_yx + @aa.decorators.to_vector_yx def deflections_yx_2d_from(self, grid): return np.full(shape=(self.shape, 2), fill_value=self.value) diff --git a/autogalaxy/profiles/geometry_profiles.py b/autogalaxy/profiles/geometry_profiles.py index 74919f4cc..e908b7641 100644 --- a/autogalaxy/profiles/geometry_profiles.py +++ b/autogalaxy/profiles/geometry_profiles.py @@ -99,7 +99,7 @@ class SphProfile(GeometryProfile): def __init__(self, centre: Tuple[float, float] = (0.0, 0.0)): super().__init__(centre=centre) - @aa.grid_dec.to_array + @aa.decorators.to_array def radial_grid_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs) -> np.ndarray: """ Convert a grid of (y, x) coordinates, to their radial distances from the profile @@ -126,7 +126,7 @@ def angle_to_profile_grid_from( """ return xp.cos(grid_angles), xp.sin(grid_angles) - @aa.grid_dec.to_grid + @aa.decorators.to_grid def _cartesian_grid_via_radial_from( self, grid: aa.type.Grid2DLike, @@ -153,7 +153,7 @@ def _cartesian_grid_via_radial_from( return xp.multiply(radius[:, None], xp.vstack((sin_theta, cos_theta)).T) - @aa.grid_dec.to_grid + @aa.decorators.to_grid def transformed_to_reference_frame_grid_from(self, grid, xp=np, **kwargs): """ Transform a grid of (y,x) coordinates to the reference frame of the profile. @@ -167,7 +167,7 @@ def transformed_to_reference_frame_grid_from(self, grid, xp=np, **kwargs): """ return xp.subtract(grid.array, xp.array(self.centre)) - @aa.grid_dec.to_grid + @aa.decorators.to_grid def transformed_from_reference_frame_grid_from(self, grid, xp=np, **kwargs): """ Transform a grid of (y,x) coordinates from the reference frame of the profile to the original observer @@ -282,7 +282,7 @@ def angle_to_profile_grid_from(self, grid_angles, xp=np, **kwargs): theta_coordinate_to_profile = xp.add(grid_angles, -self.angle_radians(xp=xp)) return xp.cos(theta_coordinate_to_profile), xp.sin(theta_coordinate_to_profile) - @aa.grid_dec.to_grid + @aa.decorators.to_grid def rotated_grid_from_reference_frame_from( self, grid, xp=np, angle: Optional[float] = None, **kwargs ): @@ -313,7 +313,7 @@ def rotated_grid_from_reference_frame_from( grid_2d=grid, centre=(0.0, 0.0), angle=angle, xp=xp ) - @aa.grid_dec.to_array + @aa.decorators.to_array def elliptical_radii_grid_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: @@ -332,7 +332,7 @@ def elliptical_radii_grid_from( ) ) - @aa.grid_dec.to_array + @aa.decorators.to_array def eccentric_radii_grid_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: @@ -354,7 +354,7 @@ def eccentric_radii_grid_from( return xp.multiply(xp.sqrt(self.axis_ratio(xp)), grid_radii.array) - @aa.grid_dec.to_grid + @aa.decorators.to_grid def transformed_to_reference_frame_grid_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: @@ -374,7 +374,7 @@ def transformed_to_reference_frame_grid_from( grid_2d=grid.array, centre=self.centre, angle=self.angle(xp), xp=xp ) - @aa.grid_dec.to_grid + @aa.decorators.to_grid def transformed_from_reference_frame_grid_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> aa.type.Grid2DLike: diff --git a/autogalaxy/profiles/light/mock/mock_light_profile.py b/autogalaxy/profiles/light/mock/mock_light_profile.py index fbadb455f..cc3a472f2 100644 --- a/autogalaxy/profiles/light/mock/mock_light_profile.py +++ b/autogalaxy/profiles/light/mock/mock_light_profile.py @@ -27,7 +27,7 @@ def __init__( self.value = value self.value1 = value1 - @aa.grid_dec.to_array + @aa.decorators.to_array @check_operated_only def image_2d_from( self, grid, xp=np, operated_only: Optional[bool] = None, **kwargs diff --git a/autogalaxy/profiles/light/standard/chameleon.py b/autogalaxy/profiles/light/standard/chameleon.py index f3923dc6d..9623fbc78 100644 --- a/autogalaxy/profiles/light/standard/chameleon.py +++ b/autogalaxy/profiles/light/standard/chameleon.py @@ -90,9 +90,9 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, xp=np) -> np.ndarray: ) @aa.over_sample - @aa.grid_dec.to_array + @aa.decorators.to_array @check_operated_only - @aa.grid_dec.transform + @aa.decorators.transform def image_2d_from( self, grid: aa.type.Grid2DLike, diff --git a/autogalaxy/profiles/light/standard/eff.py b/autogalaxy/profiles/light/standard/eff.py index 27cbd2df2..c24bf60d9 100644 --- a/autogalaxy/profiles/light/standard/eff.py +++ b/autogalaxy/profiles/light/standard/eff.py @@ -58,9 +58,9 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, xp=np) -> np.ndarray: ) @aa.over_sample - @aa.grid_dec.to_array + @aa.decorators.to_array @check_operated_only - @aa.grid_dec.transform + @aa.decorators.transform def image_2d_from( self, grid: aa.type.Grid2DLike, diff --git a/autogalaxy/profiles/light/standard/gaussian.py b/autogalaxy/profiles/light/standard/gaussian.py index cac80287f..327f0956d 100644 --- a/autogalaxy/profiles/light/standard/gaussian.py +++ b/autogalaxy/profiles/light/standard/gaussian.py @@ -72,9 +72,9 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, xp=np) -> np.ndarray: ) @aa.over_sample - @aa.grid_dec.to_array + @aa.decorators.to_array @check_operated_only - @aa.grid_dec.transform + @aa.decorators.transform def image_2d_from( self, grid: aa.type.Grid2DLike, diff --git a/autogalaxy/profiles/light/standard/moffat.py b/autogalaxy/profiles/light/standard/moffat.py index 87a9412c9..dcd8fa5d2 100644 --- a/autogalaxy/profiles/light/standard/moffat.py +++ b/autogalaxy/profiles/light/standard/moffat.py @@ -71,9 +71,9 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, xp=np) -> np.ndarray: ) @aa.over_sample - @aa.grid_dec.to_array + @aa.decorators.to_array @check_operated_only - @aa.grid_dec.transform + @aa.decorators.transform def image_2d_from( self, grid: aa.type.Grid2DLike, diff --git a/autogalaxy/profiles/light/standard/sersic.py b/autogalaxy/profiles/light/standard/sersic.py index 95c26fae7..93874f6f7 100644 --- a/autogalaxy/profiles/light/standard/sersic.py +++ b/autogalaxy/profiles/light/standard/sersic.py @@ -164,9 +164,9 @@ def image_2d_via_radii_from( ) @aa.over_sample - @aa.grid_dec.to_array + @aa.decorators.to_array @check_operated_only - @aa.grid_dec.transform + @aa.decorators.transform def image_2d_from( self, grid: aa.type.Grid2DLike, diff --git a/autogalaxy/profiles/light/standard/shapelets/cartesian.py b/autogalaxy/profiles/light/standard/shapelets/cartesian.py index 95b7c8d8f..1513f44aa 100644 --- a/autogalaxy/profiles/light/standard/shapelets/cartesian.py +++ b/autogalaxy/profiles/light/standard/shapelets/cartesian.py @@ -87,9 +87,9 @@ def coefficient_tag(self) -> str: return f"n_y_{self.n_y}_n_x_{self.n_x}" @aa.over_sample - @aa.grid_dec.to_array + @aa.decorators.to_array @check_operated_only - @aa.grid_dec.transform + @aa.decorators.transform def image_2d_from( self, grid: aa.type.Grid2DLike, diff --git a/autogalaxy/profiles/light/standard/shapelets/exponential.py b/autogalaxy/profiles/light/standard/shapelets/exponential.py index 0231d7351..02d1cf0f9 100644 --- a/autogalaxy/profiles/light/standard/shapelets/exponential.py +++ b/autogalaxy/profiles/light/standard/shapelets/exponential.py @@ -60,9 +60,9 @@ def coefficient_tag(self) -> str: return f"n_{self.n}_m_{self.m}" @aa.over_sample - @aa.grid_dec.to_array + @aa.decorators.to_array @check_operated_only - @aa.grid_dec.transform + @aa.decorators.transform def image_2d_from( self, grid: aa.type.Grid2DLike, diff --git a/autogalaxy/profiles/light/standard/shapelets/polar.py b/autogalaxy/profiles/light/standard/shapelets/polar.py index e91501a15..fb5a68474 100644 --- a/autogalaxy/profiles/light/standard/shapelets/polar.py +++ b/autogalaxy/profiles/light/standard/shapelets/polar.py @@ -122,9 +122,9 @@ def coefficient_tag(self) -> str: return f"n_{self.n}_m_{self.m}" @aa.over_sample - @aa.grid_dec.to_array + @aa.decorators.to_array @check_operated_only - @aa.grid_dec.transform + @aa.decorators.transform def image_2d_from( self, grid: aa.type.Grid2DLike, diff --git a/autogalaxy/profiles/mass/abstract/mge.py b/autogalaxy/profiles/mass/abstract/mge.py index 5b38f3407..f1dee37d5 100644 --- a/autogalaxy/profiles/mass/abstract/mge.py +++ b/autogalaxy/profiles/mass/abstract/mge.py @@ -147,8 +147,8 @@ def wofz(z, xp=np): return w - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_2d_via_mge_from( self, grid: aa.type.Grid2DLike, @@ -298,8 +298,8 @@ def zeta_from(self, grid: aa.type.Grid2DLike, sigma_log_list, xp=np): return xp.where(ind_pos_y[None, :], core, xp.conj(core)) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_via_mge_from( self, grid: aa.type.Grid2DLike, diff --git a/autogalaxy/profiles/mass/dark/abstract.py b/autogalaxy/profiles/mass/dark/abstract.py index 1f6d8f4e0..ee65c4738 100644 --- a/autogalaxy/profiles/mass/dark/abstract.py +++ b/autogalaxy/profiles/mass/dark/abstract.py @@ -51,8 +51,8 @@ def __init__( self.inner_slope = inner_slope @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/dark/cnfw.py b/autogalaxy/profiles/mass/dark/cnfw.py index fad6354d6..00e9ad88b 100644 --- a/autogalaxy/profiles/mass/dark/cnfw.py +++ b/autogalaxy/profiles/mass/dark/cnfw.py @@ -75,7 +75,7 @@ def density_3d_func(self, r, xp=np): * (r.array + self.scale_radius) ** (-2.0) ) - @aa.grid_dec.to_array + @aa.decorators.to_array def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Convergence (dimensionless surface mass density) for the cored NFW profile. @@ -83,7 +83,7 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ return xp.zeros(shape=grid.shape[0]) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Lensing potential for the cored NFW profile. @@ -122,8 +122,8 @@ def __init__( self.scale_radius = scale_radius self.core_radius = core_radius - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -235,7 +235,7 @@ def dev_F_func(self, theta, radius, xp=np): return 2 * dev_F - @aa.grid_dec.to_array + @aa.decorators.to_array def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Convergence (dimensionless surface mass density) for the cored NFW profile. @@ -243,7 +243,7 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ return xp.zeros(shape=grid.shape[0]) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Lensing potential for the cored NFW profile. diff --git a/autogalaxy/profiles/mass/dark/nfw.py b/autogalaxy/profiles/mass/dark/nfw.py index 278d11e2f..2fef3acf1 100644 --- a/autogalaxy/profiles/mass/dark/nfw.py +++ b/autogalaxy/profiles/mass/dark/nfw.py @@ -45,8 +45,8 @@ def __init__( def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return self.deflections_2d_via_analytic_from(grid=grid, xp=xp, **kwargs) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_2d_via_analytic_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ): @@ -105,14 +105,14 @@ def deflections_2d_via_analytic_from( return xp.multiply(self.scale_radius, xp.vstack((deflection_y, deflection_x)).T) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_2d_via_cse_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return self._deflections_2d_via_cse_from(grid=grid, **kwargs) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_via_cse_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the projected 2D convergence from a grid of (y,x) arc second coordinates, by computing and summing @@ -185,8 +185,8 @@ def nfw_2d(r): sample_points=sample_points, ) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def shear_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Analytic calculation shear from Heyrovský & Karamazov 2024 @@ -227,8 +227,8 @@ def shear_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return aa.VectorYX2DIrregular(values=shear_field, grid=grid) - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Analytic calculation convergence from Heyrovský & Karamazov 2024 @@ -298,8 +298,8 @@ def __init__( def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return self.deflections_2d_via_analytic_from(grid=grid, xp=xp, **kwargs) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_2d_via_analytic_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ): @@ -331,8 +331,8 @@ def deflection_func_sph(self, grid_radius, xp=np): return xp.real(self.coord_func_h(grid_radius=grid_radius, xp=xp)) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the potential at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/dark/nfw_truncated.py b/autogalaxy/profiles/mass/dark/nfw_truncated.py index 7badabd11..02e5a17f7 100644 --- a/autogalaxy/profiles/mass/dark/nfw_truncated.py +++ b/autogalaxy/profiles/mass/dark/nfw_truncated.py @@ -26,8 +26,8 @@ def __init__( self.truncation_radius = truncation_radius self.tau = self.truncation_radius / self.scale_radius - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. @@ -62,7 +62,7 @@ def convergence_func(self, grid_radius: float, xp=np) -> float: 2.0 * self.kappa_s * self.coord_func_l(grid_radius=grid_radius.array, xp=xp) ) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.zeros(shape=grid.shape[0]) diff --git a/autogalaxy/profiles/mass/point/point.py b/autogalaxy/profiles/mass/point/point.py index b6c73fd34..72c7da540 100644 --- a/autogalaxy/profiles/mass/point/point.py +++ b/autogalaxy/profiles/mass/point/point.py @@ -34,12 +34,12 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): # convergence[central_pixel] = np.pi * self.einstein_radius ** 2.0 return convergence - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return np.zeros(shape=grid.shape[0]) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): grid_radii = self.radial_grid_from(grid=grid, xp=xp, **kwargs) return self._cartesian_grid_via_radial_from( diff --git a/autogalaxy/profiles/mass/sheets/external_shear.py b/autogalaxy/profiles/mass/sheets/external_shear.py index b13386f17..59225d774 100644 --- a/autogalaxy/profiles/mass/sheets/external_shear.py +++ b/autogalaxy/profiles/mass/sheets/external_shear.py @@ -40,11 +40,11 @@ def convergence_func(self, grid_radius: float) -> float: def average_convergence_of_1_radius(self): return 0.0 - @aa.grid_dec.to_array + @aa.decorators.to_array def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.zeros(shape=grid.shape[0]) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): shear_angle = ( self.angle(xp) - 90 @@ -56,8 +56,8 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return -0.5 * shear_amp * rcoord**2 * xp.cos(2 * (phicoord - phig)) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/sheets/mass_sheet.py b/autogalaxy/profiles/mass/sheets/mass_sheet.py index 297e2af9d..2d0f440ef 100644 --- a/autogalaxy/profiles/mass/sheets/mass_sheet.py +++ b/autogalaxy/profiles/mass/sheets/mass_sheet.py @@ -24,16 +24,16 @@ def __init__(self, centre: Tuple[float, float] = (0.0, 0.0), kappa: float = 0.0) def convergence_func(self, grid_radius: float) -> float: return 0.0 - @aa.grid_dec.to_array + @aa.decorators.to_array def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.full(shape=grid.shape[0], fill_value=self.kappa) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.zeros(shape=grid.shape[0]) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): grid_radii = self.radial_grid_from(grid=grid, xp=xp, **kwargs) return self._cartesian_grid_via_radial_from( diff --git a/autogalaxy/profiles/mass/stellar/chameleon.py b/autogalaxy/profiles/mass/stellar/chameleon.py index a8f767d98..8bb979e68 100644 --- a/autogalaxy/profiles/mass/stellar/chameleon.py +++ b/autogalaxy/profiles/mass/stellar/chameleon.py @@ -50,8 +50,8 @@ def __init__( def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return self.deflections_2d_via_analytic_from(grid=grid, xp=xp, **kwargs) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_2d_via_analytic_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ): @@ -131,8 +131,8 @@ def deflections_2d_via_analytic_from( return xp.multiply(factor, xp.vstack((deflection_y, deflection_x)).T) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. Parameters @@ -149,7 +149,7 @@ def convergence_func(self, grid_radius: float, xp=np) -> float: grid_radius, xp=xp ) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.zeros(shape=grid.shape[0]) diff --git a/autogalaxy/profiles/mass/stellar/gaussian.py b/autogalaxy/profiles/mass/stellar/gaussian.py index 255e63767..0fe43d8da 100644 --- a/autogalaxy/profiles/mass/stellar/gaussian.py +++ b/autogalaxy/profiles/mass/stellar/gaussian.py @@ -50,8 +50,8 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ return self.deflections_2d_via_analytic_from(grid=grid, xp=xp, **kwargs) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_2d_via_analytic_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ): @@ -76,8 +76,8 @@ def deflections_2d_via_analytic_from( return xp.vstack((-1.0 * xp.imag(deflections), xp.real(deflections))).T @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. @@ -96,7 +96,7 @@ def convergence_func(self, grid_radius: float, xp=np) -> float: grid_radius, xp=xp ) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.zeros(shape=grid.shape[0]) diff --git a/autogalaxy/profiles/mass/stellar/sersic.py b/autogalaxy/profiles/mass/stellar/sersic.py index 3709a0187..e2c6c6cb8 100644 --- a/autogalaxy/profiles/mass/stellar/sersic.py +++ b/autogalaxy/profiles/mass/stellar/sersic.py @@ -122,8 +122,8 @@ def __init__( def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return self.deflections_2d_via_cse_from(grid=grid, xp=xp, **kwargs) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_2d_via_cse_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the projected 2D deflection angles from a grid of (y,x) arc second coordinates, by computing and @@ -141,8 +141,8 @@ def deflections_2d_via_cse_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs) return self._deflections_2d_via_cse_from(grid=grid, xp=xp, **kwargs) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. @@ -157,8 +157,8 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): ) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_via_cse_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the projected 2D convergence from a grid of (y,x) arc second coordinates, by computing and summing @@ -183,7 +183,7 @@ def convergence_func(self, grid_radius: float, xp=np) -> float: grid_radius, xp=xp ) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return np.zeros(shape=grid.shape[0]) diff --git a/autogalaxy/profiles/mass/stellar/sersic_gradient.py b/autogalaxy/profiles/mass/stellar/sersic_gradient.py index aac7a3cf1..cd77f2d0c 100644 --- a/autogalaxy/profiles/mass/stellar/sersic_gradient.py +++ b/autogalaxy/profiles/mass/stellar/sersic_gradient.py @@ -50,8 +50,8 @@ def __init__( self.mass_to_light_gradient = mass_to_light_gradient @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/total/dual_pseudo_isothermal_mass.py b/autogalaxy/profiles/mass/total/dual_pseudo_isothermal_mass.py index 7cf04df0b..ddf8396db 100644 --- a/autogalaxy/profiles/mass/total/dual_pseudo_isothermal_mass.py +++ b/autogalaxy/profiles/mass/total/dual_pseudo_isothermal_mass.py @@ -262,8 +262,8 @@ def _ellip(self, xp=np): MAX_ELLIP = 0.99999 return xp.min(xp.array([ellip, MAX_ELLIP])) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -292,8 +292,8 @@ def _convergence(self, radii, xp=np): return self.b0 / 2 * (1 / xp.sqrt(a**2 + radsq)) - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Returns the two-dimensional projected convergence on a grid of (y,x) @@ -317,7 +317,7 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return kappa - @aa.grid_dec.transform + @aa.decorators.transform def analytical_hessian_2d_from(self, grid: "aa.type.Grid2DLike", xp=np, **kwargs): """ Calculate the hessian matrix on a grid of (y,x) arc-second coordinates. @@ -412,8 +412,8 @@ def _ellip(self, xp=np): MAX_ELLIP = 0.99999 return xp.min(xp.array([ellip, MAX_ELLIP])) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -453,8 +453,8 @@ def _convergence(self, radii, xp=np): * (1 / xp.sqrt(a**2 + radsq) - 1 / xp.sqrt(s**2 + radsq)) ) - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates. @@ -475,7 +475,7 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): kappa = self._convergence(grid_radii, xp) return kappa - @aa.grid_dec.transform + @aa.decorators.transform def analytical_hessian_2d_from(self, grid: "aa.type.Grid2DLike", xp=np, **kwargs): """ Calculate the hessian matrix on a grid of (y,x) arc-second coordinates. @@ -529,7 +529,7 @@ def analytical_magnification_2d_from( return aa.Array2D(values=1.0 / det_A, mask=grid.mask) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.zeros(shape=grid.shape[0]) @@ -583,8 +583,8 @@ def __init__( self.rs = rs self.b0 = b0 - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -619,8 +619,8 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.vstack((deflection_y, deflection_x)).T - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates. @@ -638,7 +638,7 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return self._convergence(xp.sqrt(radsq), xp) - @aa.grid_dec.transform + @aa.decorators.transform def analytical_hessian_2d_from(self, grid: "aa.type.Grid2DLike", xp=np, **kwargs): """ Calculate the hessian matrix on a grid of (y,x) arc-second coordinates. diff --git a/autogalaxy/profiles/mass/total/dual_pseudo_isothermal_potential.py b/autogalaxy/profiles/mass/total/dual_pseudo_isothermal_potential.py index c925922c8..e3da5af14 100644 --- a/autogalaxy/profiles/mass/total/dual_pseudo_isothermal_potential.py +++ b/autogalaxy/profiles/mass/total/dual_pseudo_isothermal_potential.py @@ -93,8 +93,8 @@ def _convergence(self, radii, xp=np): * (1 / xp.sqrt(a**2 + radsq) - 1 / xp.sqrt(s**2 + radsq)) ) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -118,8 +118,8 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.vstack((deflection_y, deflection_x)).T - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates. @@ -151,7 +151,7 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): # zero over all space return kappa_circ * (1 - asymm_term) + (alpha_circ / grid_radii) * asymm_term - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.zeros(shape=grid.shape[0]) @@ -209,8 +209,8 @@ def __init__( self.rs = rs self.b0 = b0 - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -230,8 +230,8 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return aa.Grid2DIrregular.from_yx_1d(defl_y, defl_x) - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates. @@ -249,6 +249,6 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return self._convergence(xp.sqrt(radsq), xp) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.zeros(shape=grid.shape[0]) diff --git a/autogalaxy/profiles/mass/total/isothermal.py b/autogalaxy/profiles/mass/total/isothermal.py index d1f5e91e7..af9b693a3 100644 --- a/autogalaxy/profiles/mass/total/isothermal.py +++ b/autogalaxy/profiles/mass/total/isothermal.py @@ -70,8 +70,8 @@ def axis_ratio(self, xp=np): axis_ratio = super().axis_ratio(xp=xp) return xp.minimum(axis_ratio, 0.99999) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -107,8 +107,8 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): ) return xp.multiply(factor, xp.vstack((deflection_y, deflection_x)).T) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def shear_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the (gamma_y, gamma_x) shear vector field on a grid of (y,x) arc-second coordinates. @@ -174,8 +174,8 @@ def axis_ratio(self, xp=np): return 1.0 @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the potential on a grid of (y,x) arc-second coordinates. @@ -188,8 +188,8 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): eta = self.elliptical_radii_grid_from(grid=grid, xp=xp, **kwargs) return 2.0 * self.einstein_radius_rescaled(xp) * eta - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. diff --git a/autogalaxy/profiles/mass/total/power_law.py b/autogalaxy/profiles/mass/total/power_law.py index 036c10610..55af3f395 100644 --- a/autogalaxy/profiles/mass/total/power_law.py +++ b/autogalaxy/profiles/mass/total/power_law.py @@ -37,7 +37,7 @@ def __init__( core_radius=0.0, ) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): alpha = self.deflections_yx_2d_from( @@ -52,8 +52,8 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return (x * alpha_x + y * alpha_y) / (3 - self.slope) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -164,8 +164,8 @@ def __init__( slope=slope, ) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): eta = self.radial_grid_from(grid=grid, xp=xp, **kwargs).array deflection_r = ( diff --git a/autogalaxy/profiles/mass/total/power_law_broken.py b/autogalaxy/profiles/mass/total/power_law_broken.py index 1d57c3283..72406452b 100644 --- a/autogalaxy/profiles/mass/total/power_law_broken.py +++ b/autogalaxy/profiles/mass/total/power_law_broken.py @@ -49,8 +49,8 @@ def __init__( self.kB = (2 - self.inner_slope) / (2 * self.nu**2) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Returns the dimensionless density kappa=Sigma/Sigma_c (eq. 1) @@ -69,12 +69,12 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): radius > self.break_radius ) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return xp.zeros(shape=grid.shape[0]) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_yx_2d_from(self, grid, xp=np, max_terms=20, **kwargs): """ Returns the complex deflection angle from eq. 18 and 19 diff --git a/autogalaxy/profiles/mass/total/power_law_core.py b/autogalaxy/profiles/mass/total/power_law_core.py index 6f352112a..b1f30ca99 100644 --- a/autogalaxy/profiles/mass/total/power_law_core.py +++ b/autogalaxy/profiles/mass/total/power_law_core.py @@ -47,8 +47,8 @@ def einstein_radius_rescaled(self, xp=np): ) * self.einstein_radius ** (self.slope - 1) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates. @@ -66,8 +66,8 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return self.convergence_func(grid_radius=grid_eta) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the potential on a grid of (y,x) arc-second coordinates. @@ -97,8 +97,8 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): return self.einstein_radius_rescaled(xp) * self.axis_ratio(xp) * potential_grid - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform(rotate_back=True) + @aa.decorators.to_vector_yx + @aa.decorators.transform(rotate_back=True) def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -204,8 +204,8 @@ def __init__( core_radius=core_radius, ) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. diff --git a/autogalaxy/profiles/mass/total/power_law_multipole.py b/autogalaxy/profiles/mass/total/power_law_multipole.py index d58d2db89..f3d04e907 100644 --- a/autogalaxy/profiles/mass/total/power_law_multipole.py +++ b/autogalaxy/profiles/mass/total/power_law_multipole.py @@ -206,8 +206,8 @@ def jacobian( a_r * xp.cos(polar_angle_grid) - a_angle * xp.sin(polar_angle_grid), ) - @aa.grid_dec.to_vector_yx - @aa.grid_dec.transform + @aa.decorators.to_vector_yx + @aa.decorators.transform def deflections_yx_2d_from( self, grid: aa.type.Grid1D2DLike, xp=np, **kwargs ) -> np.ndarray: @@ -256,8 +256,8 @@ def deflections_yx_2d_from( ) @aa.over_sample - @aa.grid_dec.to_array - @aa.grid_dec.transform + @aa.decorators.to_array + @aa.decorators.transform def convergence_2d_from( self, grid: aa.type.Grid1D2DLike, xp=np, **kwargs ) -> np.ndarray: @@ -280,7 +280,7 @@ def convergence_2d_from( * xp.cos(self.m * (angle - angle_m)) ) - @aa.grid_dec.to_array + @aa.decorators.to_array def potential_2d_from( self, grid: aa.type.Grid2DLike, xp=np, **kwargs ) -> np.ndarray: diff --git a/test_autogalaxy/profiles/mass/test_transform_rotate_back.py b/test_autogalaxy/profiles/mass/test_transform_rotate_back.py index f75ddc5bf..b11017567 100644 --- a/test_autogalaxy/profiles/mass/test_transform_rotate_back.py +++ b/test_autogalaxy/profiles/mass/test_transform_rotate_back.py @@ -2,7 +2,7 @@ Tests for the automatic back-rotation feature of the transform decorator (Phase 2). These tests capture the expected deflection values from the current manual back-rotation -approach. After switching to automatic back-rotation via @aa.grid_dec.transform(rotate_back=True), +approach. After switching to automatic back-rotation via @aa.decorators.transform(rotate_back=True), the same values must be produced. """ import numpy as np