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 3, 2024
1 parent 8050003 commit d44aaed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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
8 changes: 4 additions & 4 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,10 +74,10 @@ 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, x=ebins_centres)
assert variable_width_broaden.units == 1/ebins.units
adaptively_broadened_dos_area = simps(variable_width_broaden.magnitude,
ebins_centres)
adaptively_broadened_dos_area = simpson(
variable_width_broaden.magnitude, x=ebins_centres)
assert adaptively_broadened_dos_area == pytest.approx(dos_area, rel=0.01)


Expand Down

0 comments on commit d44aaed

Please sign in to comment.