Skip to content

Commit

Permalink
fixed some issues with paper.md and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Elaine Ran committed Sep 27, 2023
1 parent 25ecc0e commit 70faa86
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions simsz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@

try:
from simsz.filters import get_tSZ_signal_aperture_photometry
from simsz.utils import Mpc_to_arcmin
except ModuleNotFoundError:
pass
3 changes: 1 addition & 2 deletions tests/test_simtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ def test_f_sz(self):
T_CMB = cosmo.Tcmb0
fsz = simtools.f_sz(freq,T_CMB)
fsz_expected = 12.509
assert u.isclose(fsz,fsz_expected),
f"Expected {fsz_expected}, but got {fsz}"
assert u.isclose(fsz,fsz_expected),f"Expected {fsz_expected}, but got {fsz}"
2 changes: 1 addition & 1 deletion tests/test_szcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_Pth_Battaglia2012(self):
x = radii/R200 #As defined in Battaglia 2012
Pth_expected = P0 * (x/xc)**(-0.3) * (1 + (x/xc))**(-beta)
result = Pth_Battaglia2012(radii,R200,-0.3,1.0,beta,xc,P0)
assert np.allclose(result, Pth_expected), f"Expected {Pth_expected}, but got {result}"
assert np.allclose(result, Pth_expected),f"Expected {Pth_expected}, but got {result}"

def test_epp_to_y(self):
'''
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def test_arcmin_to_Mpc(self):
(cosmo,sigma8,ns) = get_mock_cosmology()
value_expected = 0.559219683539306
value_calculated = arcmin_to_Mpc(r, z, cosmo)
assert u.isclose(value_calculated, value_expected), f"Expected {value_expected}, but got {value_calculated}"
assert u.isclose(value_calculated, value_expected),f"Expected {value_expected}, but got {value_calculated}"

def test_Mpc_to_arcmin(self):
r = 1
z = 0.5
(cosmo,sigma8,ns) = get_mock_cosmology()
value_expected = 1.7882060117608733
value_calculated = Mpc_to_arcmin(r, z, cosmo)
assert u.isclose(value_calculated, value_expected), f"Expected {value_expected}, but got {value_calculated}"
assert u.isclose(value_calculated, value_expected),f"Expected {value_expected}, but got {value_calculated}"

0 comments on commit 70faa86

Please sign in to comment.