From 71d357a8ac649201986af10b20037490ee4a0bf0 Mon Sep 17 00:00:00 2001 From: Steven Murray Date: Mon, 15 Apr 2024 11:08:00 +0200 Subject: [PATCH] docs: add FAQ about high-k camb transfer --- CHANGELOG.rst | 6 +++++- docs/faq.rst | 24 ++++++++++++++++++++++++ setup.cfg | 3 ++- setup.py | 5 ----- src/hmf/density_field/transfer_models.py | 10 +++++++++- 5 files changed, 40 insertions(+), 8 deletions(-) delete mode 100644 setup.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5819662..94874ff 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,11 @@ Releases dev-version ---------------------- +**Changes** + +* Changed the ``CAMB`` transfer model to use ``extrapolate_with_eh=True`` by default, + which improves the accuracy of the HMF at low mass. + v3.4.4 [16 Jan 2023] ---------------------- @@ -11,7 +16,6 @@ v3.4.3 [12 Sep 2022] ---------------------- **Changes** ------------ - No longer supporting =1.0.0 colossus>=1.2.1 - halomod==1.4.6.dev58 + halomod>=1.4.6 dev = hmf[docs,tests] + setuptools_scm cosmo = colossus>=1.2.1 fit = diff --git a/setup.py b/setup.py deleted file mode 100644 index c99d4ff..0000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Setup the package.""" - -from setuptools import setup - -setup() diff --git a/src/hmf/density_field/transfer_models.py b/src/hmf/density_field/transfer_models.py index df0e71f..2542abc 100644 --- a/src/hmf/density_field/transfer_models.py +++ b/src/hmf/density_field/transfer_models.py @@ -164,7 +164,7 @@ class CAMB(FromFile): _defaults = { "camb_params": None, "dark_energy_params": {}, - "extrapolate_with_eh": False, + "extrapolate_with_eh": None, "kmax": None, } @@ -229,6 +229,14 @@ def __init__(self, *args, **kwargs): w=self.cosmo.w0, wa=self.cosmo.wa ) + if self.params["extrapolate_with_eh"] is None: + warnings.warn( + "'extrapolate_with_eh' was not set. Defaulting to True, which is " + "different behaviour than versions <=3.4.4. This warning may be " + "removed in v4.0. Silence it by setting extrapolate_with_eh explicitly." + ) + self.params["extrapolate_with_eh"] = True + if self.params["extrapolate_with_eh"]: # Create an EH transfer to extrapolate to at high k. self._eh = EH(self.cosmo)