Skip to content

Commit

Permalink
Test density weight
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy committed Nov 25, 2024
1 parent a6ed9cd commit c82a16f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/test_shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RadialWindow,
combine, # noqa: F401
cubic_windows,
density_weight, # noqa: F401
density_weight,
distance_grid, # noqa: F401
distance_weight,
linear_windows,
Expand Down Expand Up @@ -57,7 +57,20 @@ def test_volume_weight(cosmo: Cosmology) -> None:

def test_density_weight(cosmo: Cosmology) -> None:
"""Add unit tests for :func:`density_weight`."""
# AttributeError: 'MockCosmology' object has no attribute 'rho_m_z'
z = np.linspace(0, 1, 6)

# check shape

w = density_weight(z, cosmo)
np.testing.assert_array_equal(w.shape, z.shape)

# check first value is 0

np.testing.assert_array_equal(w[0], 0)

# check values are increasing

np.testing.assert_array_less(w[:-1], w[1:])


def test_tophat_windows() -> None:
Expand Down

0 comments on commit c82a16f

Please sign in to comment.