Skip to content

Commit e7abe93

Browse files
ahms5mberz
authored andcommitted
cleanup tests
1 parent c7e94ce commit e7abe93

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

tests/test_samplings.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -472,21 +472,18 @@ def test_em64():
472472
np.sum(sampling.weights), 4*np.pi, atol=1e-6, rtol=1e-6)
473473

474474

475-
def test_hyperinterpolation(download_sampling):
476-
n_max = 1
477-
download_sampling('hyperinterpolation', n_max)
478-
sampling = samplings.hyperinterpolation(n_max=n_max)
479-
assert sampling.radius.size == (n_max+1)**2
480-
481-
482475
def test_hyperinterpolation_default(download_sampling):
483-
# test default behavior
484-
download_sampling('hyperinterpolation', [1])
476+
n_max = 1
477+
# download just required sampling for testing
478+
download_sampling('hyperinterpolation', [n_max])
485479

486-
# test with n_max 1
487480
c = samplings.hyperinterpolation(1)
481+
482+
# test sampling properties
488483
assert type(c) is SamplingSphere
489-
assert c.csize == 4
484+
assert c.n_max == n_max
485+
assert c.csize == (n_max+1)**2
486+
assert c.radius.size == (n_max+1)**2
490487

491488
# test default radius
492489
npt.assert_allclose(c.radius, 1, atol=1e-15)
@@ -496,11 +493,8 @@ def test_hyperinterpolation_default(download_sampling):
496493
@pytest.mark.parametrize("radius", [1, 5])
497494
def test_hyperinterpolation_radius(download_sampling, radius):
498495
download_sampling('hyperinterpolation', [1])
499-
# check if n_max is set properly
500496
sampling = samplings.hyperinterpolation(1, radius=radius)
501497
assert type(sampling) is SamplingSphere
502-
assert sampling.n_max == 1
503-
assert isinstance(sampling.n_max, int)
504498
npt.assert_allclose(sampling.radius, radius, atol=1e-15)
505499

506500

0 commit comments

Comments
 (0)