diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d85d97b0e..47f844591 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,8 +31,6 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest - python-version: "3.10" - os: ubuntu-latest python-version: "3.11" - os: ubuntu-latest @@ -62,9 +60,9 @@ jobs: pip install git+https://github.com/halomod/halomod.git@main pip install -e .[dev] - # Coverage only on Ubuntu + Python 3.11 + # Coverage only on Ubuntu + Python 3.12 - name: Run Tests (with coverage) - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' run: | python -m pytest \ --cov=onepower \ @@ -76,26 +74,25 @@ jobs: # Other matrix combos run without coverage - name: Run Tests (without coverage) - if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.11' + if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.12' run: | python -m pytest --durations=25 - name: Generate coverage badge - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' && success() && github.event_name == 'push' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && success() && github.event_name == 'push' run : | pip install genbadge[coverage] genbadge coverage -i "cov.xml" -o "coverage.svg" - #uses: tj-actions/coverage-badge-py@v2 - name: Verify Changed files - if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' && success() && github.event_name == 'push' + if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && success() && github.event_name == 'push' id: verify uses: tj-actions/verify-changed-files@v20 with: files: coverage.svg - name: Commit and push badge - if: steps.verify.outputs.files_changed == 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' && success() && github.event_name == 'push' + if: steps.verify.outputs.files_changed == 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && success() && github.event_name == 'push' run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7c84e7d2c..11a63e1e3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ dev-version * Performance improvements in Bnl non-linear corrections. * Added more defaults in CosmosSIS interface, so the Pmm case can be run without any HOD parameters needed. +* Deprecated Python 3.10, planning to drop support for 3.11 when ``hmf/halomod`` does the same. **Fixes** diff --git a/README.md b/README.md index 36c44e1aa..5ae36a4d9 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ OnePower is ideal for: 💾 [Install via PyPI](https://pypi.org/project/onepower/) +🖥️ [Use a web app](https://onepower.dvrnk.si) + ## Example usage diff --git a/pyproject.toml b/pyproject.toml index 8315a8f46..6caf5d297 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ authors = [ license = "MIT" license-files = ["LICEN[CS]E*"] -requires-python = ">=3.10, <3.13" +requires-python = ">=3.11, <3.13" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", @@ -24,7 +24,6 @@ classifiers = [ "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", diff --git a/src/onepower/hod.py b/src/onepower/hod.py index cb216d0e9..b86c683b5 100644 --- a/src/onepower/hod.py +++ b/src/onepower/hod.py @@ -124,6 +124,8 @@ def dndlnm_int(self): array_like interpolated halo mass function at self.z """ + if np.array_equal(self.z, self.z_vec): + return self.dndlnm dndlnm_fnc = interp1d( self.z_vec, self.dndlnm, @@ -144,6 +146,8 @@ def halo_bias_int(self): array_like interpolated halo bias function at self.z """ + if np.array_equal(self.z, self.z_vec): + return self.halo_bias halo_bias_fnc = interp1d( self.z_vec, self.halo_bias, diff --git a/src/onepower/pk.py b/src/onepower/pk.py index 229b7169e..1648f026e 100644 --- a/src/onepower/pk.py +++ b/src/onepower/pk.py @@ -942,7 +942,7 @@ def two_halo_truncation_ia(self): return np.ones_like(self.k_vec) return np.exp(-((self.k_vec / self.two_halo_ktrunc_ia) ** 2.0)) - def one_halo_truncation_mead(self, sigma8_in): + def one_halo_truncation_mead2020(self, sigma8_in): """ 1-halo term truncation in Mead et al. 2021, eq 17 and table 2. @@ -962,7 +962,7 @@ def one_halo_truncation_mead(self, sigma8_in): k_frac = self.k_vec[np.newaxis, np.newaxis, :] / k_star return (k_frac**4.0) / (1.0 + k_frac**4.0) - def two_halo_truncation_mead(self, sigma8_in): + def two_halo_truncation_mead2020(self, sigma8_in): """ 2-halo term truncation in Mead et al. 2021, eq 16. @@ -1588,15 +1588,15 @@ def _power_spectrum_mm( pk_tot = pk_1h + pk_2h elif self.nonlinear_mode == 'hmcode': if self.hmcode_ingredients in ['mead2020_feedback', 'mead2020']: - pk_2h = self._pk_lin[np.newaxis, :, :] * self.two_halo_truncation_mead( - self.sigma8_z - ) + pk_2h = self._pk_lin[ + np.newaxis, :, : + ] * self.two_halo_truncation_mead2020(self.sigma8_z) pk_1h = self.compute_1h_term( matter_profile_1h, matter_profile_1h, self.mass[np.newaxis, np.newaxis, np.newaxis, :], self.dndlnm[np.newaxis, :, np.newaxis, :], - ) * self.one_halo_truncation_mead(self.sigma8_z) + ) * self.one_halo_truncation_mead2020(self.sigma8_z) pk_tot = self.transition_smoothing(self.neff, pk_1h, pk_2h) # elif here to include mead2016 etc if ever implemented ... else: