Skip to content

Commit

Permalink
Update deprecated scipy.integrate simps -> simpson
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Jul 2, 2024
1 parent 8050003 commit 5e45920
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Compatibility fix for Numpy 2.0 update: avoid some
broadcasting issues with array shape returned by ``np.unique``

- Update reference to scipy.integrate.simpson

-------------------------------------------------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions tests_and_analysis/test/euphonic_test/test_broadening.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from numpy.polynomial import Polynomial
from numpy.random import RandomState
import numpy.testing as npt
from scipy.integrate import simps
from scipy.integrate import simpson
from scipy.ndimage import gaussian_filter

from euphonic.broadening import (find_coeffs,
Expand Down Expand Up @@ -74,9 +74,9 @@ def test_area_unchanged_for_broadened_dos(material, qpt_freqs_json,
fit='cheby-log')
ebins_centres = ebins.magnitude[:-1] + 0.5*np.diff(ebins.magnitude)
assert dos.y_data.units == 1/ebins.units
dos_area = simps(dos.y_data.magnitude, ebins_centres)
dos_area = simpson(dos.y_data.magnitude, ebins_centres)
assert variable_width_broaden.units == 1/ebins.units
adaptively_broadened_dos_area = simps(variable_width_broaden.magnitude,
adaptively_broadened_dos_area = simpson(variable_width_broaden.magnitude,
ebins_centres)
assert adaptively_broadened_dos_area == pytest.approx(dos_area, rel=0.01)

Expand Down

0 comments on commit 5e45920

Please sign in to comment.