From 8086f335092b4cd8aebc0ad534967649df5eadef Mon Sep 17 00:00:00 2001 From: James Nightingale Date: Wed, 6 Nov 2024 18:45:16 +0000 Subject: [PATCH 1/2] another fix --- autogalaxy/profiles/mass/total/power_law_multipole.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autogalaxy/profiles/mass/total/power_law_multipole.py b/autogalaxy/profiles/mass/total/power_law_multipole.py index 3de7bc24..9a1f40d9 100644 --- a/autogalaxy/profiles/mass/total/power_law_multipole.py +++ b/autogalaxy/profiles/mass/total/power_law_multipole.py @@ -171,7 +171,7 @@ def deflections_yx_2d_from( * self.einstein_radius ** (self.slope - 1.0) * radial_grid ** (2.0 - self.slope) ) - / (self.m**2.0 - (3.0 - self.slope)) + / (self.m**2.0 - (3.0 - self.slope)**2.0) * self.k_m * np.cos(self.m * (polar_angle_grid - self.angle_m)) ) @@ -182,7 +182,7 @@ def deflections_yx_2d_from( * self.einstein_radius ** (self.slope - 1.0) * radial_grid ** (2.0 - self.slope) ) - / (self.m**2.0 - (3.0 - self.slope)) + / (self.m**2.0 - (3.0 - self.slope)**2.0) * self.k_m * np.sin(self.m * (polar_angle_grid - self.angle_m)) ) From a5288cfe324cf363f00254e3e42b705f3a4f66e6 Mon Sep 17 00:00:00 2001 From: James Nightingale Date: Wed, 6 Nov 2024 19:04:33 +0000 Subject: [PATCH 2/2] fix unit test --- .../profiles/mass/total/test_power_law_multipole.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test_autogalaxy/profiles/mass/total/test_power_law_multipole.py b/test_autogalaxy/profiles/mass/total/test_power_law_multipole.py index 9db5eacd..29271d67 100644 --- a/test_autogalaxy/profiles/mass/total/test_power_law_multipole.py +++ b/test_autogalaxy/profiles/mass/total/test_power_law_multipole.py @@ -16,8 +16,8 @@ def test__deflections_yx_2d_from(): deflections = mp.deflections_yx_2d_from(grid=ag.Grid2DIrregular([[1.0, 0.0]])) - assert deflections[0, 0] == pytest.approx(-0.036501212434, 1e-3) - assert deflections[0, 1] == pytest.approx(-0.04812739471, 1e-3) + assert deflections[0, 0] == pytest.approx(-0.036120991, 1e-3) + assert deflections[0, 1] == pytest.approx(-0.0476260676, 1e-3) mp = ag.mp.PowerLawMultipole( m=4, @@ -29,8 +29,8 @@ def test__deflections_yx_2d_from(): deflections = mp.deflections_yx_2d_from(grid=ag.Grid2DIrregular([[1.0, 0.0]])) - assert deflections[0, 0] == pytest.approx(-0.093819734, 1e-3) - assert deflections[0, 1] == pytest.approx(-0.12642225085, 1e-3) + assert deflections[0, 0] == pytest.approx(-0.096376665, 1e-3) + assert deflections[0, 1] == pytest.approx(-0.1298677210, 1e-3) def test__convergence_2d_from():