From ba850de98dfa28ab20d59ddc658ae0e4c1989e4f Mon Sep 17 00:00:00 2001 From: Colm Talbot Date: Mon, 15 Dec 2025 15:47:33 -0500 Subject: [PATCH 1/4] TST: add tests for planck15_lal --- pyproject.toml | 1 + wcosmo/test/conftest.py | 1 + wcosmo/test/test_cosmo.py | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bb6f586..9e1979e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ test = [ "coverage", "pre-commit", "pytest-cov", + 'lal; 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", diff --git a/wcosmo/test/conftest.py b/wcosmo/test/conftest.py index 1e9acf4..26f57f3 100644 --- a/wcosmo/test/conftest.py +++ b/wcosmo/test/conftest.py @@ -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", ] diff --git a/wcosmo/test/test_cosmo.py b/wcosmo/test/test_cosmo.py index e97afd0..712d83a 100644 --- a/wcosmo/test/test_cosmo.py +++ b/wcosmo/test/test_cosmo.py @@ -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"Bilby not available for {cosmo}") + elif isinstance(cosmo, str): ours = astropy.available[cosmo] theirs = getattr(cosmology, cosmo) else: From 870972ff78d2006ba613d5976b2dbeb41ad5e4ce Mon Sep 17 00:00:00 2001 From: Colm Talbot Date: Mon, 15 Dec 2025 15:48:47 -0500 Subject: [PATCH 2/4] fix typo in pytest message --- wcosmo/test/test_cosmo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcosmo/test/test_cosmo.py b/wcosmo/test/test_cosmo.py index 712d83a..f4657d5 100644 --- a/wcosmo/test/test_cosmo.py +++ b/wcosmo/test/test_cosmo.py @@ -48,7 +48,7 @@ def get_equivalent_cosmologies(cosmo): Ode0=1 - lal.OMEGA_M, ) except ImportError: - pytest.skip(f"Bilby not available for {cosmo}") + pytest.skip(f"LAL not available for {cosmo}") elif isinstance(cosmo, str): ours = astropy.available[cosmo] theirs = getattr(cosmology, cosmo) From d40d397eb73b05d02905aed080555f5d0863f1d7 Mon Sep 17 00:00:00 2001 From: Colm Talbot Date: Mon, 15 Dec 2025 15:50:15 -0500 Subject: [PATCH 3/4] TYPO: typo in requirements --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9e1979e..026aee6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ test = [ "coverage", "pre-commit", "pytest-cov", - 'lal; python_version<=3.13', + '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", From 967b732fdbbc5d1d072553867d8b72feebd18189 Mon Sep 17 00:00:00 2001 From: Colm Talbot Date: Mon, 15 Dec 2025 15:51:36 -0500 Subject: [PATCH 4/4] BUG: typo in pyprojet --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 026aee6..cbac7be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ test = [ "coverage", "pre-commit", "pytest-cov", - 'lalsuite; python_version<=3.13', + '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",