Skip to content

Commit

Permalink
fill in missing rho methods
Browse files Browse the repository at this point in the history
rho_b, rho_dm, rho_gamma, rho_nu

Signed-off-by: nstarman <[email protected]>
  • Loading branch information
nstarman committed Jan 19, 2023
1 parent 3866b08 commit 0077ad6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/cosmology/api/flrw.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class FLRWAPIConformant(CosmologyAPIConformant, Protocol):
"""Baryon density parameter at redshift 0."""

# ==============================================================
# Derived properties

@property
def scale_factor0(self) -> Array:
Expand Down Expand Up @@ -395,6 +394,22 @@ def rho_k(self, z: Array, /) -> Array:
"""Redshift-dependent curvature density in Msol Mpc-3."""
...

def rho_gamma(self, z: Array, /) -> Array:
"""Redshift-dependent photon density in Msol Mpc-3."""
...

def rho_nu(self, z: Array, /) -> Array:
"""Redshift-dependent neutrino density in Msol Mpc-3."""
...

def rho_b(self, z: Array, /) -> Array:
"""Redshift-dependent baryon density in Msol Mpc-3."""
...

def rho_dm(self, z: Array, /) -> Array:
"""Redshift-dependent dark matter density in Msol Mpc-3."""
...

# ----------------------------------------------
# Time

Expand Down
4 changes: 4 additions & 0 deletions tests/api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def flrw_meths() -> set[str]:
"rho_m",
"rho_de",
"rho_k",
"rho_b",
"rho_dm",
"rho_gamma",
"rho_nu",
"age",
"lookback_time",
"comoving_distance",
Expand Down

0 comments on commit 0077ad6

Please sign in to comment.