diff --git a/.mypyignore-todo b/.mypyignore-todo index 35936667..1514ef34 100644 --- a/.mypyignore-todo +++ b/.mypyignore-todo @@ -1,16 +1,3 @@ -scipy\.ndimage\.__all__ -scipy\.ndimage\.(_?filters\.)?convolve -scipy\.ndimage\.(_?filters\.)?correlate -scipy\.ndimage\.(_?filters\.)?laplace -scipy\.ndimage\.(_?filters\.)?generic_filter -scipy\.ndimage\.(_?filters\.)?(gaussian|generic)_(gradient_magnitude|laplace) -scipy\.ndimage\.(_?morphology\.)?(black|white)_tophat -scipy\.ndimage\.(_?morphology\.)?binary_(propagation|fill_holes|hit_or_miss) -scipy\.ndimage\.(_?morphology\.)?(binary|grey)_(closing|opening|dilation|erosion) -scipy\.ndimage\.(_?morphology\.)?morphological_(gradient|laplace) -scipy\.ndimage\._ni_docstrings\.docfiller -scipy\.ndimage\._ni_support\._extend_mode_to_code - scipy\.optimize\.elementwise scipy\.optimize\._cobyqa_py\.COBYQA_LOCK scipy\.optimize\.(_basinhopping\.)?basinhopping diff --git a/scipy-stubs/ndimage/__init__.pyi b/scipy-stubs/ndimage/__init__.pyi index 6c815ce9..29bea2b9 100644 --- a/scipy-stubs/ndimage/__init__.pyi +++ b/scipy-stubs/ndimage/__init__.pyi @@ -1,4 +1,13 @@ -from . import filters, fourier, interpolation, measurements, morphology +# Deprecated namespaces, to be removed in v2.0.0 +from . import ( + filters as filters, + fourier as fourier, + interpolation as interpolation, + measurements as measurements, + morphology as morphology, +) + +# from ._filters import ( convolve, convolve1d, @@ -36,8 +45,48 @@ from ._interpolation import ( spline_filter1d, zoom, ) -from ._measurements import * -from ._morphology import * +from ._measurements import ( + center_of_mass, + extrema, + find_objects, + histogram, + label, + labeled_comprehension, + maximum, + maximum_position, + mean, + median, + minimum, + minimum_position, + standard_deviation, + sum, + sum_labels, + value_indices, + variance, + watershed_ift, +) +from ._morphology import ( + binary_closing, + binary_dilation, + binary_erosion, + binary_fill_holes, + binary_hit_or_miss, + binary_opening, + binary_propagation, + black_tophat, + distance_transform_bf, + distance_transform_cdt, + distance_transform_edt, + generate_binary_structure, + grey_closing, + grey_dilation, + grey_erosion, + grey_opening, + iterate_structure, + morphological_gradient, + morphological_laplace, + white_tophat, +) __all__ = [ "affine_transform", @@ -58,9 +107,7 @@ __all__ = [ "distance_transform_cdt", "distance_transform_edt", "extrema", - "filters", "find_objects", - "fourier", "fourier_ellipsoid", "fourier_gaussian", "fourier_shift", @@ -80,7 +127,6 @@ __all__ = [ "grey_erosion", "grey_opening", "histogram", - "interpolation", "iterate_structure", "label", "labeled_comprehension", @@ -91,7 +137,6 @@ __all__ = [ "maximum_filter1d", "maximum_position", "mean", - "measurements", "median", "median_filter", "minimum", @@ -100,7 +145,6 @@ __all__ = [ "minimum_position", "morphological_gradient", "morphological_laplace", - "morphology", "percentile_filter", "prewitt", "rank_filter", diff --git a/scipy-stubs/ndimage/_filters.pyi b/scipy-stubs/ndimage/_filters.pyi index 0b346768..da75128a 100644 --- a/scipy-stubs/ndimage/_filters.pyi +++ b/scipy-stubs/ndimage/_filters.pyi @@ -38,6 +38,24 @@ _Mode: TypeAlias = Literal["reflect", "constant", "nearest", "mirror", "wrap", " _Modes: TypeAlias = _Mode | Sequence[_Mode] _Ints: TypeAlias = int | Sequence[int] +_FilterFunc1D: TypeAlias = Callable[Concatenate[onp.ArrayND[np.float64], onp.ArrayND[np.float64], ...], None] +_FilterFuncND: TypeAlias = Callable[ + Concatenate[onp.ArrayND[np.float64], ...], + onp.ToComplex | _ScalarValueOut | _ScalarArrayOut, +] +_Derivative: TypeAlias = Callable[ + # (input, axis, output, mode, cval, *extra_arguments, **extra_keywords) + Concatenate[_ScalarArrayOut, int, np.dtype[_ScalarValueOut], _Mode, onp.ToComplex, ...], + _ScalarArrayOut, +] + +@type_check_only +class _GaussianKwargs(TypedDict, total=False): + truncate: float + radius: _Ints + +### + # TODO: allow passing dtype-likes to `output` # @@ -46,6 +64,8 @@ def laplace( output: _ScalarArrayOut | None = None, mode: _Modes = "reflect", cval: onp.ToComplex = 0.0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... # @@ -56,6 +76,8 @@ def prewitt( mode: _Modes = "reflect", cval: onp.ToComplex = 0.0, ) -> _ScalarArrayOut: ... + +# def sobel( input: onp.ToComplex | onp.ToComplexND, axis: int = -1, @@ -74,6 +96,8 @@ def correlate1d( cval: onp.ToComplex = 0.0, origin: int = 0, ) -> _ScalarArrayOut: ... + +# def convolve1d( input: onp.ToComplex | onp.ToComplexND, weights: onp.ToFloat | onp.ToFloat1D, @@ -92,7 +116,11 @@ def correlate( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: _Ints = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... + +# def convolve( input: onp.ToComplex | onp.ToComplexND, weights: onp.ToFloat | onp.ToFloatND, @@ -100,30 +128,31 @@ def convolve( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: _Ints = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... # - -@type_check_only -class _GaussianKwargs(TypedDict, total=False): - truncate: float - radius: _Ints - axes: tuple[int, ...] - def gaussian_laplace( input: onp.ToComplex | onp.ToComplexND, sigma: onp.ToFloat | onp.ToFloatND, output: _ScalarArrayOut | None = None, mode: _Modes = "reflect", cval: onp.ToComplex = 0.0, + *, + axes: tuple[int, ...] | None = None, **kwargs: Unpack[_GaussianKwargs], ) -> _ScalarArrayOut: ... + +# def gaussian_gradient_magnitude( input: onp.ToComplex | onp.ToComplexND, sigma: onp.ToFloat | onp.ToFloatND, output: _ScalarArrayOut | None = None, mode: _Modes = "reflect", cval: onp.ToComplex = 0.0, + *, + axes: tuple[int, ...] | None = None, **kwargs: Unpack[_GaussianKwargs], ) -> _ScalarArrayOut: ... @@ -156,12 +185,6 @@ def gaussian_filter( ) -> _ScalarArrayOut: ... # -_Derivative: TypeAlias = Callable[ - # (input, axis, output, mode, cval, *extra_arguments, **extra_keywords) - Concatenate[_ScalarArrayOut, int, np.dtype[_ScalarValueOut], _Mode, onp.ToComplex, ...], - _ScalarArrayOut, -] - def generic_laplace( input: onp.ToComplex | onp.ToComplexND, derivative2: _Derivative, @@ -170,7 +193,11 @@ def generic_laplace( cval: onp.ToComplex = 0.0, extra_arguments: tuple[object, ...] = (), extra_keywords: dict[str, object] | None = None, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... + +# def generic_gradient_magnitude( input: onp.ToComplex | onp.ToComplexND, derivative: _Derivative, @@ -179,10 +206,11 @@ def generic_gradient_magnitude( cval: onp.ToComplex = 0.0, extra_arguments: tuple[object, ...] = (), extra_keywords: dict[str, object] | None = None, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... # -_FilterFunc1D: TypeAlias = Callable[Concatenate[onp.ArrayND[np.float64], onp.ArrayND[np.float64], ...], None] def generic_filter1d( input: onp.ToFloat | onp.ToFloatND, @@ -198,11 +226,6 @@ def generic_filter1d( ) -> _FloatArrayOut: ... # -_FilterFuncND: TypeAlias = Callable[ - Concatenate[onp.ArrayND[np.float64], ...], - onp.ToComplex | _ScalarValueOut | _ScalarArrayOut, -] - def generic_filter( input: onp.ToFloat | onp.ToFloatND, function: _FilterFuncND | LowLevelCallable, @@ -214,6 +237,8 @@ def generic_filter( origin: _Ints = 0, extra_arguments: tuple[object, ...] = (), extra_keywords: dict[str, object] | None = None, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... # @@ -226,6 +251,8 @@ def uniform_filter1d( cval: onp.ToComplex = 0.0, origin: int = 0, ) -> _ScalarArrayOut: ... + +# def minimum_filter1d( input: onp.ToComplex | onp.ToComplexND, size: int, @@ -235,6 +262,8 @@ def minimum_filter1d( cval: onp.ToComplex = 0.0, origin: int = 0, ) -> _ScalarArrayOut: ... + +# def maximum_filter1d( input: onp.ToComplex | onp.ToComplexND, size: int, @@ -269,6 +298,8 @@ def minimum_filter( *, axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... + +# def maximum_filter( input: onp.ToComplex | onp.ToComplexND, size: int | tuple[int, ...] | None = None, @@ -307,6 +338,8 @@ def rank_filter( *, axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... + +# def percentile_filter( input: onp.ToComplex | onp.ToComplexND, percentile: onp.ToFloat, diff --git a/scipy-stubs/ndimage/_morphology.pyi b/scipy-stubs/ndimage/_morphology.pyi index 0f4b227b..e32466bd 100644 --- a/scipy-stubs/ndimage/_morphology.pyi +++ b/scipy-stubs/ndimage/_morphology.pyi @@ -41,6 +41,8 @@ def iterate_structure( origin: _Origin | None = None, ) -> _BoolArrayOut: ... def generate_binary_structure(rank: int, connectivity: int) -> _BoolArrayOut: ... + +# def binary_erosion( input: onp.ToComplex | onp.ToComplexND, structure: onp.ToInt | onp.ToIntND | None = None, @@ -50,6 +52,8 @@ def binary_erosion( border_value: _BorderValue = 0, origin: _Origin = 0, brute_force: onp.ToBool = False, + *, + axes: tuple[int, ...] | None = None, ) -> _BoolArrayOut: ... def binary_dilation( input: onp.ToComplex | onp.ToComplexND, @@ -60,6 +64,8 @@ def binary_dilation( border_value: _BorderValue = 0, origin: _Origin = 0, brute_force: onp.ToBool = False, + *, + axes: tuple[int, ...] | None = None, ) -> _BoolArrayOut: ... def binary_opening( input: onp.ToComplex | onp.ToComplexND, @@ -70,6 +76,8 @@ def binary_opening( mask: onp.ToInt | onp.ToIntND | None = None, border_value: _BorderValue = 0, brute_force: onp.ToBool = False, + *, + axes: tuple[int, ...] | None = None, ) -> _BoolArrayOut: ... def binary_closing( input: onp.ToComplex | onp.ToComplexND, @@ -80,7 +88,11 @@ def binary_closing( mask: onp.ToInt | onp.ToIntND | None = None, border_value: _BorderValue = 0, brute_force: onp.ToBool = False, + *, + axes: tuple[int, ...] | None = None, ) -> _BoolArrayOut: ... + +# def binary_hit_or_miss( input: onp.ToComplex | onp.ToComplexND, structure1: onp.ToInt | onp.ToIntND | None = None, @@ -88,6 +100,8 @@ def binary_hit_or_miss( output: _BoolArrayOut | type[bool | np.bool_] | None = None, origin1: _Origin = 0, origin2: _Origin | None = None, + *, + axes: tuple[int, ...] | None = None, ) -> _BoolArrayOut: ... def binary_propagation( input: onp.ToComplex | onp.ToComplexND, @@ -96,13 +110,19 @@ def binary_propagation( output: _BoolArrayOut | type[bool | np.bool_] | None = None, border_value: _BorderValue = 0, origin: _Origin = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _BoolArrayOut: ... def binary_fill_holes( input: onp.ToComplex | onp.ToComplexND, structure: onp.ToInt | onp.ToIntND | None = None, output: _BoolArrayOut | None = None, origin: _Origin = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _BoolArrayOut: ... + +# def grey_erosion( input: onp.ToComplex | onp.ToComplexND, size: tuple[int, ...] | None = None, @@ -112,6 +132,8 @@ def grey_erosion( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: _Origin = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... def grey_dilation( input: onp.ToComplex | onp.ToComplexND, @@ -122,6 +144,8 @@ def grey_dilation( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: _Origin = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... def grey_opening( input: onp.ToComplex | onp.ToComplexND, @@ -132,6 +156,8 @@ def grey_opening( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: _Origin = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... def grey_closing( input: onp.ToComplex | onp.ToComplexND, @@ -142,7 +168,11 @@ def grey_closing( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: _Origin = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... + +# def morphological_gradient( input: onp.ToComplex | onp.ToComplexND, size: tuple[int, ...] | None = None, @@ -152,6 +182,8 @@ def morphological_gradient( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: _Origin = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... def morphological_laplace( input: onp.ToComplex | onp.ToComplexND, @@ -162,7 +194,11 @@ def morphological_laplace( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: _Origin = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... + +# def white_tophat( input: onp.ToComplex | onp.ToComplexND, size: tuple[int, ...] | None = None, @@ -172,6 +208,8 @@ def white_tophat( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: _Origin = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... def black_tophat( input: onp.ToComplex | onp.ToComplexND, @@ -182,7 +220,11 @@ def black_tophat( mode: _Mode = "reflect", cval: onp.ToComplex = 0.0, origin: onp.ToComplex = 0, + *, + axes: tuple[int, ...] | None = None, ) -> _ScalarArrayOut: ... + +# def distance_transform_bf( input: onp.ToComplex | onp.ToComplexND, metric: _MetricBF = "euclidean", diff --git a/scipy-stubs/ndimage/_ni_docstrings.pyi b/scipy-stubs/ndimage/_ni_docstrings.pyi deleted file mode 100644 index 83987c0d..00000000 --- a/scipy-stubs/ndimage/_ni_docstrings.pyi +++ /dev/null @@ -1,13 +0,0 @@ -__all__ = ["docfiller"] - -from typing import Final, TypeVar - -import optype as op - -_F = TypeVar("_F", bound=op.HasDoc) - -# -docdict: Final[dict[str, str]] # undocumented - -# -def docfiller(f: _F) -> _F: ... # undocumented diff --git a/scipy-stubs/ndimage/_ni_support.pyi b/scipy-stubs/ndimage/_ni_support.pyi deleted file mode 100644 index 6f01e4a5..00000000 --- a/scipy-stubs/ndimage/_ni_support.pyi +++ /dev/null @@ -1,55 +0,0 @@ -from collections.abc import Iterable -from typing import Any, Literal, TypeAlias, TypeVar, overload - -import numpy as np -import optype as op -import optype.numpy as onp -from scipy.ndimage._typing import _ScalarValueOut - -_Mode: TypeAlias = Literal["nearest", "wrap", "reflect", "grid-mirror", "mirror", "constant", "grid-wrap", "grid-constant"] -_ModeCode: TypeAlias = Literal[0, 1, 2, 3, 4, 5, 6] - -_T = TypeVar("_T") -_ShapeT = TypeVar("_ShapeT", bound=tuple[int, ...]) -_ComplexT = TypeVar("_ComplexT", bound=np.complex64 | np.complex128 | np.clongdouble) -_ScalarT = TypeVar("_ScalarT", bound=np.number[Any] | np.bool_) - -# -def _extend_mode_to_code(mode: _Mode) -> _ModeCode: ... -@overload -def _normalize_sequence(input: str, rank: int) -> list[str]: ... -@overload -def _normalize_sequence(input: Iterable[_T], rank: int) -> list[_T]: ... -@overload -def _normalize_sequence(input: _T, rank: int) -> list[_T]: ... - -# -@overload -def _get_output( - output: onp.Array[_ShapeT, _ScalarT] | type[_ScalarT] | np.dtype[_ScalarT] | None, - input: onp.Array[_ShapeT | tuple[int, ...], _ScalarT], - shape: _ShapeT | None = None, - complex_output: Literal[False] = False, -) -> onp.ArrayND[_ScalarT]: ... -@overload -def _get_output( - output: onp.Array[_ShapeT, _ComplexT] | type[_ComplexT] | np.dtype[_ComplexT] | None, - input: onp.Array[_ShapeT | tuple[int, ...], _ComplexT], - shape: _ShapeT | None = None, - *, - complex_output: Literal[True], -) -> onp.ArrayND[_ComplexT]: ... -@overload -def _get_output( - output: onp.Array[_ShapeT, _ScalarValueOut] | type[onp.ToComplex] | np.dtype[_ScalarValueOut] | None, - input: onp.Array[_ShapeT | tuple[int, ...], _ScalarValueOut], - shape: _ShapeT | None = None, - *, - complex_output: Literal[True], -) -> onp.ArrayND[np.complex64 | np.complex128 | np.clongdouble]: ... - -# -@overload -def _check_axes(axes: op.CanIndex, ndim: op.CanIndex) -> tuple[int]: ... -@overload -def _check_axes(axes: Iterable[op.CanIndex] | None, ndim: op.CanIndex) -> tuple[int, ...]: ... diff --git a/scipy-stubs/ndimage/filters.pyi b/scipy-stubs/ndimage/filters.pyi index 8aa8ca2a..74466a59 100644 --- a/scipy-stubs/ndimage/filters.pyi +++ b/scipy-stubs/ndimage/filters.pyi @@ -36,6 +36,8 @@ def convolve( mode: object = ..., cval: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def convolve1d( @@ -55,6 +57,8 @@ def correlate( mode: object = ..., cval: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def correlate1d( @@ -99,6 +103,8 @@ def gaussian_gradient_magnitude( output: object = ..., mode: object = ..., cval: object = ..., + *, + axes: tuple[int, ...] | None = None, **kwargs: object, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") @@ -108,6 +114,8 @@ def gaussian_laplace( output: object = ..., mode: object = ..., cval: object = ..., + *, + axes: tuple[int, ...] | None = None, **kwargs: object, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") @@ -122,6 +130,8 @@ def generic_filter( origin: object = ..., extra_arguments: object = ..., extra_keywords: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def generic_filter1d( @@ -145,6 +155,8 @@ def generic_gradient_magnitude( cval: object = ..., extra_arguments: object = ..., extra_keywords: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def generic_laplace( @@ -155,9 +167,18 @@ def generic_laplace( cval: object = ..., extra_arguments: object = ..., extra_keywords: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") -def laplace(input: object, output: object = ..., mode: object = ..., cval: object = ...) -> object: ... +def laplace( + input: object, + output: object = ..., + mode: object = ..., + cval: object = ..., + *, + axes: tuple[int, ...] | None = None, +) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def maximum_filter( input: object, @@ -228,8 +249,6 @@ def percentile_filter( axes: object = ..., ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") -def prewitt(input: object, axis: object = ..., output: object = ..., mode: object = ..., cval: object = ...) -> object: ... -@deprecated("will be removed in SciPy v2.0.0") def rank_filter( input: object, rank: object, @@ -243,8 +262,6 @@ def rank_filter( axes: object = ..., ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") -def sobel(input: object, axis: object = ..., output: object = ..., mode: object = ..., cval: object = ...) -> object: ... -@deprecated("will be removed in SciPy v2.0.0") def uniform_filter( input: object, size: object = ..., @@ -265,3 +282,7 @@ def uniform_filter1d( cval: object = ..., origin: object = ..., ) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def prewitt(input: object, axis: object = ..., output: object = ..., mode: object = ..., cval: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sobel(input: object, axis: object = ..., output: object = ..., mode: object = ..., cval: object = ...) -> object: ... diff --git a/scipy-stubs/ndimage/morphology.pyi b/scipy-stubs/ndimage/morphology.pyi index a3545d41..11c8fe4c 100644 --- a/scipy-stubs/ndimage/morphology.pyi +++ b/scipy-stubs/ndimage/morphology.pyi @@ -24,6 +24,7 @@ __all__ = [ "white_tophat", ] +# @deprecated("will be removed in SciPy v2.0.0") def binary_closing( input: object, @@ -34,6 +35,8 @@ def binary_closing( mask: object = ..., border_value: object = ..., brute_force: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def binary_dilation( @@ -45,6 +48,8 @@ def binary_dilation( border_value: object = ..., origin: object = ..., brute_force: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def binary_erosion( @@ -56,17 +61,8 @@ def binary_erosion( border_value: object = ..., origin: object = ..., brute_force: object = ..., -) -> object: ... -@deprecated("will be removed in SciPy v2.0.0") -def binary_fill_holes(input: object, structure: object = ..., output: object = ..., origin: object = ...) -> object: ... -@deprecated("will be removed in SciPy v2.0.0") -def binary_hit_or_miss( - input: object, - structure1: object = ..., - structure2: object = ..., - output: object = ..., - origin1: object = ..., - origin2: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def binary_opening( @@ -78,27 +74,44 @@ def binary_opening( mask: object = ..., border_value: object = ..., brute_force: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... + +# @deprecated("will be removed in SciPy v2.0.0") -def binary_propagation( +def binary_fill_holes( input: object, structure: object = ..., - mask: object = ..., output: object = ..., - border_value: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") -def black_tophat( +def binary_hit_or_miss( + input: object, + structure1: object = ..., + structure2: object = ..., + output: object = ..., + origin1: object = ..., + origin2: object = ..., + *, + axes: tuple[int, ...] | None = None, +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def binary_propagation( input: object, - size: object = ..., - footprint: object = ..., structure: object = ..., + mask: object = ..., output: object = ..., - mode: object = ..., - cval: object = ..., + border_value: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... + +# @deprecated("will be removed in SciPy v2.0.0") def distance_transform_bf( input: object, @@ -127,8 +140,8 @@ def distance_transform_edt( distances: object = ..., indices: object = ..., ) -> object: ... -@deprecated("will be removed in SciPy v2.0.0") -def generate_binary_structure(rank: object, connectivity: object) -> object: ... + +# @deprecated("will be removed in SciPy v2.0.0") def grey_closing( input: object, @@ -139,6 +152,8 @@ def grey_closing( mode: object = ..., cval: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def grey_dilation( @@ -150,6 +165,8 @@ def grey_dilation( mode: object = ..., cval: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def grey_erosion( @@ -161,6 +178,8 @@ def grey_erosion( mode: object = ..., cval: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def grey_opening( @@ -172,9 +191,11 @@ def grey_opening( mode: object = ..., cval: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... -@deprecated("will be removed in SciPy v2.0.0") -def iterate_structure(structure: object, iterations: object, origin: object = ...) -> object: ... + +# @deprecated("will be removed in SciPy v2.0.0") def morphological_gradient( input: object, @@ -185,6 +206,8 @@ def morphological_gradient( mode: object = ..., cval: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def morphological_laplace( @@ -196,7 +219,11 @@ def morphological_laplace( mode: object = ..., cval: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... + +# @deprecated("will be removed in SciPy v2.0.0") def white_tophat( input: object, @@ -207,4 +234,25 @@ def white_tophat( mode: object = ..., cval: object = ..., origin: object = ..., + *, + axes: tuple[int, ...] | None = None, ) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def black_tophat( + input: object, + size: object = ..., + footprint: object = ..., + structure: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., + *, + axes: tuple[int, ...] | None = None, +) -> object: ... + +# +@deprecated("will be removed in SciPy v2.0.0") +def iterate_structure(structure: object, iterations: object, origin: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def generate_binary_structure(rank: object, connectivity: object) -> object: ...