Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/dsf/utils/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def validate_redshift_distribution_support(
"after support/window filtering."
)

if np.any(nz_use <= 0.0):
if np.any(nz_use < 0.0):
raise ValueError(f"{name} normalization must be finite and positive.")

if trim_edge_points > 0:
Expand Down Expand Up @@ -788,4 +788,4 @@ def validate_interpolation_within_bounds(
if not np.all((x_eval_arr >= x_data_arr[0]) & (x_eval_arr <= x_data_arr[-1])):
raise ValueError(f"Requested interpolation values for {name} lie outside the data grid.")

return x_eval_arr
return x_eval_arr
12 changes: 0 additions & 12 deletions tests/test_datavec_delta_sigma_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,18 +363,6 @@ def test_delta_sigma_lens_bin_rejects_too_few_support_points(patch_halo_profile)
)


def test_delta_sigma_lens_bin_rejects_non_positive_normalization(patch_halo_profile):
"""Tests that non-positive lens-dndz normalization raises an error."""
calculator = DeltaSigmaCalculator(pk2d_func=DummyPk2DFunction())

with pytest.raises(ValueError, match="normalization must be finite and positive"):
calculator.delta_sigma_lens_bin(
r=np.array([1.0, 2.0]),
lens_dndz=(np.array([0.1, 0.2, 0.3]), np.array([1.0, 0.0, 1.0])),
cosmo="cosmo",
)


@pytest.mark.parametrize(
("z_min", "z_max"),
[
Expand Down
Loading