diff --git a/pyFAI/utils/mathutil.py b/pyFAI/utils/mathutil.py index f65eac2dd..3ea250e05 100644 --- a/pyFAI/utils/mathutil.py +++ b/pyFAI/utils/mathutil.py @@ -43,8 +43,8 @@ import math import numpy import time +import scipy.ndimage from .decorators import deprecated -scipy = None try: from ..ext import relabel as _relabel @@ -141,9 +141,6 @@ def gaussian_filter(input_img, sigma, mode="reflect", cval=0.0, use_scipy=True): Value to fill past edges of input if ``mode`` is 'constant'. Default is 0.0 """ if use_scipy: - global scipy - if scipy is None: - import scipy.ndimage res = scipy.ndimage.filters.gaussian_filter(input_img, sigma, mode=(mode or "reflect")) else: if isinstance(sigma, (list, tuple)): @@ -416,9 +413,6 @@ def shift_fft(input_img, shift_val, method="fft"): e = e0 * e1 out = abs(numpy.fft.ifft2(numpy.fft.fft2(input_img) * e)) else: - global scipy - if scipy is None: - import scipy.ndimage out = scipy.ndimage.interpolation.shift(input, shift, mode="wrap", order="infinity") return out diff --git a/pyproject.toml b/pyproject.toml index aee1cd3fb..ff6aac639 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,13 @@ classifiers = ["Development Status :: 5 - Production/Stable", ] dependencies = [ - 'numpy', 'h5py', 'fabio', 'silx', 'numexpr' + 'numpy', + 'h5py', + 'fabio', + 'silx', + 'numexpr', + 'scipy', + 'matplotlib' ] [build-system]