Skip to content

Commit b62648a

Browse files
authored
Trapezoid (#64)
* 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. * Adding lowest python version to README.md
1 parent bd2d246 commit b62648a

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python: ["3.7", "3.13"]
19+
python: ["3.9", "3.13"]
2020

2121
runs-on: ubuntu-22.04
2222

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ After installation, the code is available as a script via the `promdens` command
2323
promdens --help
2424
```
2525

26-
The minimum supported Python version is 3.7.
26+
The minimum supported Python version is 3.9.
2727
The code depends on `numpy` and `matplotlib` libraries that are automatically installed by pip.
2828
However, since pip by default installs packages into a global Python environment,
2929
it can break previously installed packages, e.g., by installing an incompatible version of numpy.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ classifiers = [
1515
]
1616
description = "Promoted Density Approach for sampling initial conditions for trajectory-based nonadiabatic photodynamics"
1717
readme = "README.md"
18-
requires-python = ">=3.7"
18+
requires-python = ">=3.9"
1919
dependencies = [
20-
"numpy>=1.15",
20+
"numpy>=2.0.0",
2121
"matplotlib~=3.0",
2222
]
2323

src/promdens/promdens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def wigner_transform(self, tprime, de):
217217
s = np.arange(0, factor[self.envelope_type]*self.fwhm, step=ds)
218218
# Note: We assume here that de is in atomic units, otherwise it needs to be divided by hbar
219219
cos = np.cos((de - loc_omega)*s)
220-
integral = 2*np.trapz(x=s,
220+
integral = 2*np.trapezoid(x=s,
221221
y=cos*self.calc_field_envelope(tprime + s/2)*self.calc_field_envelope(tprime - s/2))
222222

223223
return integral

0 commit comments

Comments
 (0)