From 543b2d2a11293873739331ee1c8ff3283efef4d2 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:49:09 +0800 Subject: [PATCH 1/5] Rename simps and update README --- README.md | 2 +- clmm/redshift/tools.py | 4 ++-- clmm/theory/parent_class.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a6b1ecc02..dd73cc3f4 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ link to this repository: https://github.com/LSSTDESC/CLMM. Please follow the gui CLMM requires Python version 3.8 or later. CLMM has the following dependencies: - [NumPy](https://www.numpy.org/) (v1.17 or later) -- [SciPy](https://scipy.org/) (v1.3 or later) +- [SciPy](https://scipy.org/) (v1.6 or later) - [Astropy](https://www.astropy.org/) (v4.0 or later for units and cosmology dependence) (Please avoid Astropy v5.0 since there is bug breaking CCL backend. It has been fixed in Astropy v5.0.1.) - [Matplotlib](https://matplotlib.org/) (for plotting and going through tutorials) diff --git a/clmm/redshift/tools.py b/clmm/redshift/tools.py index 82ffd670e..904d0579a 100644 --- a/clmm/redshift/tools.py +++ b/clmm/redshift/tools.py @@ -1,7 +1,7 @@ """General utility functions that are used in multiple modules""" import warnings import numpy as np -from scipy.integrate import simps +from scipy.integrate import simpson from scipy.interpolate import interp1d @@ -55,7 +55,7 @@ def _integ_pzfuncs(pzpdf, pzbins, zmin=0.0, zmax=5, kernel=lambda z: 1.0, ngrid= pz_matrix = np.array(pzpdf)[:, mask] kernel_matrix = kernel(z_grid) - return simps(pz_matrix * kernel_matrix, x=z_grid, axis=1) + return simpson(pz_matrix * kernel_matrix, x=z_grid, axis=1) def compute_for_good_redshifts( diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index d27b8f7c6..bcefc55ed 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -7,7 +7,7 @@ import numpy as np # functions for the 2h term -from scipy.integrate import simps, quad +from scipy.integrate import simpson, quad from scipy.special import jv from scipy.interpolate import splrep, splev @@ -230,7 +230,7 @@ def __integrand__(l_value, theta): return l_value * jv(sph_harm_ord, l_value * theta) * splev(k_value, interp_pk) l_values = np.logspace(loglbounds[0], loglbounds[1], lsteps) - kernel = np.array([simps(__integrand__(l_values, t), l_values) for t in theta]) + kernel = np.array([simpson(__integrand__(l_values, t), l_values) for t in theta]) return halobias * kernel * rho_m / (2 * np.pi * (1 + z_cl) ** 3 * da**2) def _eval_surface_density_2h( From 9cdfb728f007cf11aceac89647f643e907e30546 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:16:52 +0800 Subject: [PATCH 2/5] Update simpson keyword arg --- clmm/theory/parent_class.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index bcefc55ed..5647a7d3e 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -230,7 +230,7 @@ def __integrand__(l_value, theta): return l_value * jv(sph_harm_ord, l_value * theta) * splev(k_value, interp_pk) l_values = np.logspace(loglbounds[0], loglbounds[1], lsteps) - kernel = np.array([simpson(__integrand__(l_values, t), l_values) for t in theta]) + kernel = np.array([simpson(__integrand__(l_values, t), x=l_values) for t in theta]) return halobias * kernel * rho_m / (2 * np.pi * (1 + z_cl) ** 3 * da**2) def _eval_surface_density_2h( From 5df740f8fa6e638404926b3c2169ecb3aa06a8de Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:23:58 +0800 Subject: [PATCH 3/5] Prepare for ccl new minor versions --- clmm/theory/ccl.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index e95271031..7fcff5511 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -13,9 +13,8 @@ # Check which versions of ccl are currently supported from . import _ccl_supported_versions -if parse(ccl.__version__) < parse(_ccl_supported_versions.VMIN) or parse(ccl.__version__) > parse( - _ccl_supported_versions.VMAX -): +if (parse(ccl.__version__) < parse(_ccl_supported_versions.VMIN) + or parse(ccl.__version__).major > parse(_ccl_supported_versions.VMAX).major): raise EnvironmentError( f"Current CCL version ({ccl.__version__}) not supported by CLMM. " f"It must be between {_ccl_supported_versions.VMIN} and {_ccl_supported_versions.VMAX}." From 61ff1785d614a9c08bc51f77975e334d61548c5d Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Fri, 29 Mar 2024 05:40:46 +0800 Subject: [PATCH 4/5] Update build_check.yml --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index a87a0a0bc..0949a3d07 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -41,7 +41,7 @@ jobs: - name: Analysing the code with pylint run: | pip install pylint - pylint clmm + pylint clmm --ignored-classes=astropy.units - name: Run the unit tests run: | pip install pytest pytest-cov From 298614fd5c04cd1b049687d9930563c407b31f26 Mon Sep 17 00:00:00 2001 From: m-aguena Date: Fri, 28 Jun 2024 07:40:39 -0700 Subject: [PATCH 5/5] Update version to 1.12.2 --- clmm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clmm/__init__.py b/clmm/__init__.py index 50f8fa49f..8788f36a2 100644 --- a/clmm/__init__.py +++ b/clmm/__init__.py @@ -26,4 +26,4 @@ ) from . import support -__version__ = "1.12.1" +__version__ = "1.12.2"