Skip to content

Commit

Permalink
Update coordination_number_calculation.py (#608)
Browse files Browse the repository at this point in the history
* Update coordination_number_calculation.py

replace cumtrapz for cumulative_trapezoid

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
alvarovm and pre-commit-ci[bot] authored Nov 8, 2024
1 parent 659dc07 commit 1d58ce4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mdsuite/calculators/coordination_number_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from bokeh.models import HoverTool, LinearAxis, Span
from bokeh.models.ranges import Range1d
from bokeh.plotting import figure
from scipy.integrate import cumtrapz
from scipy.integrate import cumulative_trapezoid
from scipy.signal import find_peaks

from mdsuite import utils
Expand Down Expand Up @@ -74,7 +74,9 @@ def _integrate_rdf(radii_data: np.array, rdf_data: np.array, density: float) ->
integral_data : np.array
Cumulative integral of the RDF scaled by the radius and denisty.
"""
integral_data = cumtrapz(y=radii_data[1:] ** 2 * rdf_data[1:], x=radii_data[1:])
integral_data = cumulative_trapezoid(
y=radii_data[1:] ** 2 * rdf_data[1:], x=radii_data[1:]
)

return 4 * np.pi * density * integral_data

Expand Down

0 comments on commit 1d58ce4

Please sign in to comment.