Coverage for /usr/lib/python3/dist-packages/scipy/ndimage/filters.py: 50%

10 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-06-14 15:55 +0200

1# This file is not meant for public use and will be removed in SciPy v2.0.0. 

2# Use the `scipy.ndimage` namespace for importing the functions 

3# included below. 

4 

5import warnings 

6from . import _filters 

7 

8 

9__all__ = [ # noqa: F822 

10 'correlate1d', 'convolve1d', 'gaussian_filter1d', 

11 'gaussian_filter', 'prewitt', 'sobel', 'generic_laplace', 

12 'laplace', 'gaussian_laplace', 'generic_gradient_magnitude', 

13 'gaussian_gradient_magnitude', 'correlate', 'convolve', 

14 'uniform_filter1d', 'uniform_filter', 'minimum_filter1d', 

15 'maximum_filter1d', 'minimum_filter', 'maximum_filter', 

16 'rank_filter', 'median_filter', 'percentile_filter', 

17 'generic_filter1d', 'generic_filter', 'normalize_axis_index' 

18] 

19 

20 

21def __dir__(): 

22 return __all__ 

23 

24 

25def __getattr__(name): 

26 if name not in __all__: 

27 raise AttributeError( 

28 "scipy.ndimage.filters is deprecated and has no attribute " 

29 f"{name}. Try looking in scipy.ndimage instead.") 

30 

31 warnings.warn(f"Please use `{name}` from the `scipy.ndimage` namespace, " 

32 "the `scipy.ndimage.filters` namespace is deprecated.", 

33 category=DeprecationWarning, stacklevel=2) 

34 

35 return getattr(_filters, name)