splitwavepy icon indicating copy to clipboard operation
splitwavepy copied to clipboard

SciPy compatibility: gaussian and ricker

Open richerals opened this issue 1 year ago • 0 comments

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.gaussian has been moved to scipy.signal.windows.gaussian example AttributeError: module 'scipy.signal' has no attribute 'ricker'
  • scipy.signal.ricker has been completely removed. example AttributeError: module 'scipy.signal' has no attribute 'gaussian'

Possible Solutions for users (1 for gaussian and 2 for ricker):

  1. import scipy.signal.windows import scipy.signal scipy.signal.gaussian = scipy.signal.windows.gaussian

  2. import numpy as np from scipy import signal def 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))

richerals avatar May 18 '25 07:05 richerals