From ce18aadb1f8257e231e1e6b574326cc3683a8099 Mon Sep 17 00:00:00 2001 From: Minh Nguyen Date: Fri, 6 Oct 2023 11:55:48 -0400 Subject: [PATCH 1/2] Fix the growth function g in growth_rate() and growth_rate_fn() --- src/hmf/cosmology/growth_factor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hmf/cosmology/growth_factor.py b/src/hmf/cosmology/growth_factor.py index 9976762..a090191 100644 --- a/src/hmf/cosmology/growth_factor.py +++ b/src/hmf/cosmology/growth_factor.py @@ -163,6 +163,7 @@ def growth_factor_fn(self, zmin=0.0, inverse=False): def growth_rate(self, z): """ Growth rate, dln(d)/dln(a) from Hamilton 2000 eq. 4 + Note that the growth function g in Hamilton 2000 is defined as g=D*(1+z). Parameters ---------- @@ -173,12 +174,12 @@ def growth_rate(self, z): -1 - self.cosmo.Om(z) / 2 + self.cosmo.Ode(z) - + 5 * self.cosmo.Om(z) / (2 * self.growth_factor(z)) - ) + + 5 * self.cosmo.Om(z) / (2 * self.growth_factor(z) * (1 + z))) def growth_rate_fn(self, zmin=0): """ Growth rate, dln(d)/dln(a) from Hamilton 2000 eq. 4, as callable. + Note that the growth function g in Hamilton 2000 is defined as g=D*(1+z). Parameters ---------- @@ -196,7 +197,7 @@ def growth_rate_fn(self, zmin=0): -1 - self.cosmo.Om(z) / 2 + self.cosmo.Ode(z) - + 5 * self.cosmo.Om(z) / (2 * gfn(z)) + + 5 * self.cosmo.Om(z) / (2 * gfn(z) * (1 + z)) ) From 5753c98523d47d204d3f517822c8261c49d957d9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:56:49 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/hmf/cosmology/growth_factor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hmf/cosmology/growth_factor.py b/src/hmf/cosmology/growth_factor.py index a090191..5127b1e 100644 --- a/src/hmf/cosmology/growth_factor.py +++ b/src/hmf/cosmology/growth_factor.py @@ -174,7 +174,8 @@ def growth_rate(self, z): -1 - self.cosmo.Om(z) / 2 + self.cosmo.Ode(z) - + 5 * self.cosmo.Om(z) / (2 * self.growth_factor(z) * (1 + z))) + + 5 * self.cosmo.Om(z) / (2 * self.growth_factor(z) * (1 + z)) + ) def growth_rate_fn(self, zmin=0): """