Skip to content

Commit

Permalink
fix: changed scipy.integrate.cumtrapz import by cumulative_trapezoid …
Browse files Browse the repository at this point in the history
…in plots.py module (#265)
  • Loading branch information
pabloitu authored Aug 23, 2024
1 parent 5f84ea9 commit 62d50c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions csep/utils/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy
import string
import pandas as pandas
from scipy.integrate import cumtrapz
from scipy.integrate import cumulative_trapezoid
import scipy.stats
import matplotlib
import matplotlib.lines
Expand Down Expand Up @@ -2619,11 +2619,11 @@ def plot_Molchan_diagram(forecast, catalog, linear=True, axes=None, plot_uniform
Tab_as_score['nu'] = Table_molchan['nu']

ONE = numpy.ones(len(Tab_as_score))
Tab_as_score['CUM_BAND'] = cumtrapz(ONE, Tab_as_score['tau'], initial=0) - cumtrapz(Tab_as_score['nu'],
Tab_as_score['CUM_BAND'] = cumulative_trapezoid(ONE, Tab_as_score['tau'], initial=0) - cumulative_trapezoid(Tab_as_score['nu'],
Tab_as_score['tau'],
initial=0)
Tab_as_score['AS_score'] = numpy.divide(Tab_as_score['CUM_BAND'],
cumtrapz(ONE, Tab_as_score['tau'], initial=0) + 1e-10)
cumulative_trapezoid(ONE, Tab_as_score['tau'], initial=0) + 1e-10)
Tab_as_score.loc[Tab_as_score.index[-1], 'AS_score'] = max(0.5, Tab_as_score['AS_score'].iloc[-1])
ASscore = numpy.round(Tab_as_score.loc[Tab_as_score.index[-1], 'AS_score'], 2)

Expand Down

0 comments on commit 62d50c7

Please sign in to comment.