Skip to content

Commit

Permalink
make the code nicely formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
EiffL committed Jan 20, 2022
1 parent d465d6c commit 09d6b09
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import jax_cosmo.background as bkgrd
from jax_cosmo import Cosmology


def test_H():
# We first define equivalent CCL and jax_cosmo cosmologies
# We first define equivalent CCL and jax_cosmo cosmologies
cosmo_ccl = ccl.Cosmology(
Omega_c=0.3,
Omega_b=0.05,
Expand All @@ -17,7 +18,7 @@ def test_H():
Neff=0,
transfer_function="eisenstein_hu",
matter_power_spectrum="linear",
wa=2. # non-zero wa
wa=2.0, # non-zero wa
)

cosmo_jax = Cosmology(
Expand All @@ -28,15 +29,16 @@ def test_H():
n_s=0.96,
Omega_k=0.0,
w0=-1.0,
wa=2.0, # non-zero wa
wa=2.0, # non-zero wa
)

# Test array of scale factors
a = np.linspace(0.01, 1.0)

H_ccl = ccl.h_over_h0(cosmo_ccl, a)
H_jax = bkgrd.H(cosmo_jax, a) / 100.
assert_allclose(H_ccl, H_jax, rtol=1.e-3)
H_jax = bkgrd.H(cosmo_jax, a) / 100.0
assert_allclose(H_ccl, H_jax, rtol=1.0e-3)


def test_distances_flat():
# We first define equivalent CCL and jax_cosmo cosmologies
Expand Down

0 comments on commit 09d6b09

Please sign in to comment.