From 62d50c7372813c9ff45b9f6b848e20746b202918 Mon Sep 17 00:00:00 2001 From: Pablo Iturrieta <69042881+pabloitu@users.noreply.github.com> Date: Fri, 23 Aug 2024 22:47:39 +0200 Subject: [PATCH] fix: changed scipy.integrate.cumtrapz import by cumulative_trapezoid in plots.py module (#265) --- csep/utils/plots.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csep/utils/plots.py b/csep/utils/plots.py index 78ef1f24..6ecdbfc6 100644 --- a/csep/utils/plots.py +++ b/csep/utils/plots.py @@ -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 @@ -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)