splitwavepy
splitwavepy copied to clipboard
SciPy compatibility: gaussian and ricker
Recent versions of SciPy (1.8.0/1.9.0+) have introduced changes to the scipy.signal module. This issue tracks the compatibility implications of these changes and proposes solutions for splitwavepy. Users upgrading to newer SciPy versions may encounter AttributeError exceptions when trying to import or use these functions.
Specifically:
scipy.signal.gaussianhas been moved toscipy.signal.windows.gaussianexampleAttributeError: module 'scipy.signal' has no attribute 'ricker'scipy.signal.rickerhas been completely removed. exampleAttributeError: module 'scipy.signal' has no attribute 'gaussian'
Possible Solutions for users (1 for gaussian and 2 for ricker):
-
import scipy.signal.windowsimport scipy.signalscipy.signal.gaussian = scipy.signal.windows.gaussian -
import numpy as npfrom scipy import signaldef ricker(points, a):x = np.linspace(-(points-1)/2, (points-1)/2, points)return (1 - x**2/a**2) * np.exp(-x**2/(2*a**2))