Skip to content

Commit e2791a5

Browse files
author
Niek Wielders
committed
fix convergence and potential test
1 parent 728bcb8 commit e2791a5

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

test_autogalaxy/profiles/mass/dark/test_cnfw.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ def test__deflections_yx_2d_from():
1414
def test_convergence_2d_from():
1515
cnfw = ag.mp.cNFW(centre=(0.0, 0.0), kappa_s=0.01591814312464436, scale_radius=0.36, core_radius=0.036)
1616

17-
convergence_2d = cnfw.convergence_2d_from(grid=ag.Grid2DIrregular([[1.0, 0.0]]))
18-
convergence_r = np.sqrt(convergence_2d[0]**2 + convergence_2d[1]**2)
17+
convergence = cnfw.convergence_2d_from(grid=ag.Grid2DIrregular([[1.0, 0.0]]))
1918

20-
assert convergence_r == pytest.approx(0.0, 1.0e-4)
19+
assert convergence == pytest.approx(0.0, 1.0e-4)
2120

22-
def potential_2d_from():
21+
def test_potential_2d_from():
2322
cnfw = ag.mp.cNFW(centre=(0.0, 0.0), kappa_s=0.01591814312464436, scale_radius=0.36, core_radius=0.036)
2423

25-
potential_2d = cnfw.potential_2d_from(grid=ag.Grid2DIrregular([[1.0, 0.0]]))
26-
potential_r = np.sqrt(potential_2d[0] ** 2 + potential_2d[1] ** 2)
24+
potential = cnfw.potential_2d_from(grid=ag.Grid2DIrregular([[1.0, 0.0]]))
2725

28-
assert potential_r == pytest.approx(0.0, 1.0e-4)
26+
assert potential == pytest.approx(0.0, 1.0e-4)

0 commit comments

Comments
 (0)