From 7a7e6e89caf0a9cfdedbce39d302e0b022bc860e Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Thu, 19 Sep 2024 13:25:26 +0100 Subject: [PATCH] docs inside class, allow yoda conditions --- glass/shells.py | 5 ----- tests/test_galaxies.py | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/glass/shells.py b/glass/shells.py index 87c319de..5cf5304c 100644 --- a/glass/shells.py +++ b/glass/shells.py @@ -130,11 +130,6 @@ class RadialWindow(NamedTuple): zeff: float -RadialWindow.za.__doc__ = "Redshift array; the abscissae of the window function." -RadialWindow.wa.__doc__ = "Weight array; the values (ordinates) of the window function." -RadialWindow.zeff.__doc__ = "Effective redshift of the window." - - def tophat_windows( zbins: ArrayLike1D, dz: float = 1e-3, diff --git a/tests/test_galaxies.py b/tests/test_galaxies.py index 218b717f..554f1c1f 100644 --- a/tests/test_galaxies.py +++ b/tests/test_galaxies.py @@ -32,13 +32,13 @@ def test_redshifts_from_nz(): # test sampling redshifts = redshifts_from_nz(10, [0, 1, 2, 3, 4], [1, 0, 0, 0, 0]) - assert np.all((redshifts >= 0) & (redshifts <= 1)) + assert np.all((0 <= redshifts) & (redshifts <= 1)) # noqa: SIM300 redshifts = redshifts_from_nz(10, [0, 1, 2, 3, 4], [0, 0, 1, 0, 0]) - assert np.all((redshifts >= 1) & (redshifts <= 3)) + assert np.all((1 <= redshifts) & (redshifts <= 3)) # noqa: SIM300 redshifts = redshifts_from_nz(10, [0, 1, 2, 3, 4], [0, 0, 0, 0, 1]) - assert np.all((redshifts >= 3) & (redshifts <= 4)) + assert np.all((3 <= redshifts) & (redshifts <= 4)) # noqa: SIM300 redshifts = redshifts_from_nz(10, [0, 1, 2, 3, 4], [0, 0, 1, 1, 1]) assert not np.any(redshifts <= 1) @@ -54,7 +54,7 @@ def test_redshifts_from_nz(): redshifts = redshifts_from_nz(count, z, nz) assert redshifts.shape == (count,) - assert np.all((redshifts >= 0) & (redshifts <= 1)) + assert np.all((0 <= redshifts) & (redshifts <= 1)) # noqa: SIM300 # case: extra dimensions from count