Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hsinfan1996 committed Aug 23, 2023
1 parent f05a390 commit 1e6f164
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tests/test_theory.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def test_profiles(modeling_data, profile_init):
)
if mod.backend == "ccl" and profile_init == "einasto":
if hasattr(mod.hdpm, 'projected_quad'):
mod.use_projected_quad(True)
mod.set_projected_quad(True)
assert_allclose(
mod.eval_surface_density(
cfg["SIGMA_PARAMS"]["r_proj"], cfg["SIGMA_PARAMS"]["z_cl"], verbose=True
Expand All @@ -352,7 +352,7 @@ def test_profiles(modeling_data, profile_init):
reltol*1e-1,
)
delattr(mod.hdpm, "projected_quad")
assert_raises(NotImplementedError, mod.use_projected_quad, True)
assert_raises(NotImplementedError, mod.set_projected_quad, True)

# Functional interface tests
# alpha_ein is None unless testing Einasto with the NC and CCL backend
Expand Down
16 changes: 8 additions & 8 deletions tests/test_theory_parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_unimplemented(modeling_data):
assert_raises(NotImplementedError, mod._update_halo_density_profile)
assert_raises(NotImplementedError, mod._set_einasto_alpha, 0.5)
assert_raises(NotImplementedError, mod._get_einasto_alpha)
assert_raises(NotImplementedError, mod._use_projected_quad, True)
assert_raises(NotImplementedError, mod._set_projected_quad, True)
assert_raises(NotImplementedError, mod.eval_3d_density, [0.3], 0.3)
assert_raises(NotImplementedError, mod.eval_surface_density, [0.3], 0.3)
assert_raises(NotImplementedError, mod.eval_mean_surface_density, [0.3], 0.3)
Expand Down Expand Up @@ -163,16 +163,16 @@ def test_einasto(modeling_data):
mod.eval_magnification_bias(0.1, 2, 0.1, 0.5, verbose=True)


def test_use_projected_quad(modeling_data):
"""Test use_projected_quad method"""
def test_set_projected_quad(modeling_data):
"""Test set_projected_quad method"""
mod = theo.Modeling()
assert_raises(NotImplementedError, mod.use_projected_quad, True)
assert_raises(NotImplementedError, mod.set_projected_quad, True)

if theo.be_nick == "ccl":
assert_raises(NotImplementedError, mod.use_projected_quad, True)
assert_raises(NotImplementedError, mod.set_projected_quad, True)
mod.set_halo_density_profile("hernquist")
assert_raises(NotImplementedError, mod.use_projected_quad, True)
assert_raises(NotImplementedError, mod.set_projected_quad, True)
mod.set_halo_density_profile("einasto")
mod.use_projected_quad(True)
mod.set_projected_quad(True)
else:
assert_raises(NotImplementedError, mod.use_projected_quad, True)
assert_raises(NotImplementedError, mod.set_projected_quad, True)

0 comments on commit 1e6f164

Please sign in to comment.