From bf443937ee973b6d81f8bbc85727b5615bdb6834 Mon Sep 17 00:00:00 2001 From: Jiri Janos Date: Mon, 9 Feb 2026 13:37:45 +0100 Subject: [PATCH 1/2] Changing from np.trapz to np.trapezoid. np.trapz has been completely replaced by np.trapezoid in the latest version of numpy. Hence, we decided to support only np.trapezoid from now on. People insisting on using np.trapz can use older versions of promdens. --- .github/workflows/ci.yml | 2 +- pyproject.toml | 4 ++-- src/promdens/promdens.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 842f429..d192127 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.7", "3.13"] + python: ["3.9", "3.13"] runs-on: ubuntu-22.04 diff --git a/pyproject.toml b/pyproject.toml index fc65a63..cfa3191 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,9 +15,9 @@ classifiers = [ ] description = "Promoted Density Approach for sampling initial conditions for trajectory-based nonadiabatic photodynamics" readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.9" dependencies = [ - "numpy>=1.15", + "numpy>=2.0.0", "matplotlib~=3.0", ] diff --git a/src/promdens/promdens.py b/src/promdens/promdens.py index 21db5ed..0a24d1c 100755 --- a/src/promdens/promdens.py +++ b/src/promdens/promdens.py @@ -217,7 +217,7 @@ def wigner_transform(self, tprime, de): s = np.arange(0, factor[self.envelope_type]*self.fwhm, step=ds) # Note: We assume here that de is in atomic units, otherwise it needs to be divided by hbar cos = np.cos((de - loc_omega)*s) - integral = 2*np.trapz(x=s, + integral = 2*np.trapezoid(x=s, y=cos*self.calc_field_envelope(tprime + s/2)*self.calc_field_envelope(tprime - s/2)) return integral From 2dc4d773bd6360f6be75802547b6468959461b8c Mon Sep 17 00:00:00 2001 From: Jiri Janos Date: Mon, 9 Feb 2026 13:39:30 +0100 Subject: [PATCH 2/2] Adding lowest python version to README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2bd851..76d12a6 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ After installation, the code is available as a script via the `promdens` command promdens --help ``` -The minimum supported Python version is 3.7. +The minimum supported Python version is 3.9. The code depends on `numpy` and `matplotlib` libraries that are automatically installed by pip. However, since pip by default installs packages into a global Python environment, it can break previously installed packages, e.g., by installing an incompatible version of numpy.