Skip to content

Commit

Permalink
Use scipy.integrate.cumulative_trapezoid
Browse files Browse the repository at this point in the history
  • Loading branch information
rrjbca committed Jun 2, 2024
1 parent eb0efbf commit 155df0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion skypy/galaxies/tests/test_stellar_mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def calc_cdf(m):
mass_min = 10 ** 7
mass_max = 10 ** 13
pdf = calc_pdf(m, alpha, mass_star, mass_min, mass_max)
cdf = scipy.integrate.cumtrapz(pdf, m, initial=0)
cdf = scipy.integrate.cumulative_trapezoid(pdf, m, initial=0)
cdf = cdf / cdf[-1]
return cdf

Expand Down
4 changes: 2 additions & 2 deletions skypy/galaxies/tests/test_velocity_dispersion.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from scipy.stats import kstest
from scipy.special import gamma
from scipy.integrate import cumtrapz
from scipy.integrate import cumulative_trapezoid


def test_schechter_vdf():
Expand Down Expand Up @@ -30,7 +30,7 @@ def calc_pdf(vd):

def calc_cdf(m):
pdf = calc_pdf(m)
cdf = cumtrapz(pdf, m, initial=0)
cdf = cumulative_trapezoid(pdf, m, initial=0)
cdf /= cdf[-1]
return cdf

Expand Down

0 comments on commit 155df0f

Please sign in to comment.