From 53a2729d0b51abc6b0b0f236401c7ccf32b472b2 Mon Sep 17 00:00:00 2001 From: Ian Harrison Date: Fri, 5 Jul 2024 15:20:28 +0100 Subject: [PATCH] Compatability for scipy 1.14 (#176) * update sipy simpson * add req version for scipy * actually update function usage * macos-11 runner deprecated * updated setup-miniconda version --- .github/workflows/testing.yml | 6 +++--- pyproject.toml | 2 +- requirements.txt | 2 +- soliket/clusters/tinker.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 914197e5..236ad119 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -25,8 +25,8 @@ jobs: python-version: '3.8' toxenv: py38-test-oldest - - name: macOS 11 - os: macos-11 + - name: macOS latest + os: macos-latest python-version: '3.11' toxenv: py311-test-latest @@ -34,7 +34,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Install Conda w/ Python ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: auto-activate-base: false python-version: ${{ matrix.python-version }} diff --git a/pyproject.toml b/pyproject.toml index 2c8432d3..8003f168 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ dependencies = [ "requests", 'importlib-metadata; python_version<"3.8"', "numpy", - "scipy", + "scipy>=1.6", "pandas", # to remove "astropy", "cobaya", diff --git a/requirements.txt b/requirements.txt index 6e804eca..4835f613 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ numpy -scipy +scipy>=1.6 pandas scikit-learn pyyaml diff --git a/soliket/clusters/tinker.py b/soliket/clusters/tinker.py index 7b4d5803..55d160bb 100644 --- a/soliket/clusters/tinker.py +++ b/soliket/clusters/tinker.py @@ -6,7 +6,7 @@ """ import numpy as np -from scipy.integrate import simps +from scipy.integrate import simpson from scipy.interpolate import InterpolatedUnivariateSpline as iuSpline # Tinker stuff @@ -129,7 +129,7 @@ def sigma_sq_integral(R_grid, power_spt, k_val): ) * k ** 2 for k, i in zip(k_val, np.arange(len(k_val)))] ) - return simps(to_integ / (2 * np.pi ** 2), x=k_val, axis=0) + return simpson(to_integ / (2 * np.pi ** 2), x=k_val, axis=0) def dn_dlogM(M, z, rho, delta, k, P, comoving=False):