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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ test = [
"coverage",
"pre-commit",
"pytest-cov",
'lalsuite; python_version<="3.13"',
'jax>=0.4.34,<0.7; python_version>="3.11"', # quax is not currently compatible with jax 0.7 (https://github.com/patrick-kidger/quax/issues/71)
'jax>=0.4.34,<0.6; python_version<"3.11"', # quaxed has dropped 3.10
"unxt",
Expand Down
1 change: 1 addition & 0 deletions wcosmo/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
dict(H0=70.0, Om0=0.1, w0=0.0),
dict(H0=70.0, Om0=0.9, w0=0.0),
dict(H0=70.0, Om0=1.0, w0=0.0),
"Planck15_LAL",
]


Expand Down
15 changes: 14 additions & 1 deletion wcosmo/test/test_cosmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,20 @@ def to_numpy(arr):


def get_equivalent_cosmologies(cosmo):
if isinstance(cosmo, str):
if cosmo == "Planck15_LAL":
ours = astropy.Planck15_LAL
try:
import lal
from astropy import units

theirs = cosmology.LambdaCDM(
H0=lal.H0_SI * units.Hz,
Om0=lal.OMEGA_M,
Ode0=1 - lal.OMEGA_M,
)
except ImportError:
pytest.skip(f"LAL not available for {cosmo}")
elif isinstance(cosmo, str):
ours = astropy.available[cosmo]
theirs = getattr(cosmology, cosmo)
else:
Expand Down