Skip to content

Commit

Permalink
Merge pull request #72 from jorenham/stubtest/scipy.ndimage
Browse files Browse the repository at this point in the history
`scipy.ndimage`
  • Loading branch information
jorenham authored Oct 11, 2024
2 parents 71b176b + 23d61ff commit 4b78a5c
Show file tree
Hide file tree
Showing 18 changed files with 1,647 additions and 570 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
- name: typecheck (partial)
run: |
targets=(
"__init__.pyi"
"cluster"
"constants"
"datasets"
Expand All @@ -56,9 +55,8 @@ jobs:
"io"
"linalg"
"misc"
"ndimage"
"special"
"stats/distributions.pyi"
"version.pyi"
)
for target in "${targets[@]}"; do
poe mypy $target
Expand All @@ -84,16 +82,14 @@ jobs:
"scipy.io",
"scipy.linalg",
"scipy.misc",
# "scipy.ndimage",
"scipy.ndimage",
"scipy.odr",
"scipy.optimize",
# "scipy.signal",
# "scipy.sparse",
# "scipy.spatial",
"scipy.special",
# "scipy.stats",
"scipy.stats.contingency scipy.stats.distributions",
"scipy.version"
]
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ The exact version requirements are specified in the [`pyproject.toml`](pyproject
| `scipy.io` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :full_moon: |
| `scipy.linalg` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :waxing_gibbous_moon: |
| ~`scipy.misc`~ | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :full_moon: |
| `scipy.ndimage` | :heavy_check_mark: | :x: | :x: | :new_moon: |
| `scipy.ndimage` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :full_moon: |
| `scipy.odr` | :heavy_check_mark: | :heavy_check_mark: | :x: | :waxing_crescent_moon: |
| `scipy.optimize` | :heavy_check_mark: | :heavy_check_mark: | :x: | :first_quarter_moon: |
| `scipy.signal` | :heavy_check_mark: | :x: | :x: | :new_moon: |
Expand Down
16 changes: 8 additions & 8 deletions scipy-stubs/_lib/_ccallback.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ _FuncT_co = TypeVar("_FuncT_co", bound=_Function, covariant=True, default=_Funct
_DataT_co = TypeVar("_DataT_co", bound=_UserData | None, covariant=True, default=_UserData)

class LowLevelCallable(tuple[CapsuleType, _FuncT_co, _DataT_co], Generic[_FuncT_co, _DataT_co]):
@property
def function(self, /) -> _FuncT_co: ...
@property
def user_data(self, /) -> _DataT_co: ...
@property
def signature(self, /) -> str: ...
def __new__(
cls,
function: _FuncT_co | LowLevelCallable[_FuncT_co, _DataT_co],
Expand All @@ -36,12 +42,6 @@ class LowLevelCallable(tuple[CapsuleType, _FuncT_co, _DataT_co], Generic[_FuncT_
user_data: _UserData | None = None,
signature: str | None = None,
) -> Self: ...
@override
def __getitem__(self, idx: Never, /) -> NoReturn: ... # type: ignore[override]
# NOTE: __getitem__ will raise a ValueError
@property
def function(self, /) -> _FuncT_co: ...
@property
def user_data(self, /) -> _DataT_co: ...
@property
def signature(self, /) -> str: ...
@override
def __getitem__(self, idx: Never, /) -> NoReturn: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
122 changes: 119 additions & 3 deletions scipy-stubs/ndimage/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,122 @@
from . import filters, fourier, interpolation, measurements, morphology
from ._filters import *
from ._fourier import *
from ._interpolation import *
from ._filters import (
convolve,
convolve1d,
correlate,
correlate1d,
gaussian_filter,
gaussian_filter1d,
gaussian_gradient_magnitude,
gaussian_laplace,
generic_filter,
generic_filter1d,
generic_gradient_magnitude,
generic_laplace,
laplace,
maximum_filter,
maximum_filter1d,
median_filter,
minimum_filter,
minimum_filter1d,
percentile_filter,
prewitt,
rank_filter,
sobel,
uniform_filter,
uniform_filter1d,
)
from ._fourier import fourier_ellipsoid, fourier_gaussian, fourier_shift, fourier_uniform
from ._interpolation import (
affine_transform,
geometric_transform,
map_coordinates,
rotate,
shift,
spline_filter,
spline_filter1d,
zoom,
)
from ._measurements import *
from ._morphology import *

__all__ = [
"affine_transform",
"binary_closing",
"binary_dilation",
"binary_erosion",
"binary_fill_holes",
"binary_hit_or_miss",
"binary_opening",
"binary_propagation",
"black_tophat",
"center_of_mass",
"convolve",
"convolve1d",
"correlate",
"correlate1d",
"distance_transform_bf",
"distance_transform_cdt",
"distance_transform_edt",
"extrema",
"filters",
"find_objects",
"fourier",
"fourier_ellipsoid",
"fourier_gaussian",
"fourier_shift",
"fourier_uniform",
"gaussian_filter",
"gaussian_filter1d",
"gaussian_gradient_magnitude",
"gaussian_laplace",
"generate_binary_structure",
"generic_filter",
"generic_filter1d",
"generic_gradient_magnitude",
"generic_laplace",
"geometric_transform",
"grey_closing",
"grey_dilation",
"grey_erosion",
"grey_opening",
"histogram",
"interpolation",
"iterate_structure",
"label",
"labeled_comprehension",
"laplace",
"map_coordinates",
"maximum",
"maximum_filter",
"maximum_filter1d",
"maximum_position",
"mean",
"measurements",
"median",
"median_filter",
"minimum",
"minimum_filter",
"minimum_filter1d",
"minimum_position",
"morphological_gradient",
"morphological_laplace",
"morphology",
"percentile_filter",
"prewitt",
"rank_filter",
"rotate",
"shift",
"sobel",
"spline_filter",
"spline_filter1d",
"standard_deviation",
"sum",
"sum_labels",
"uniform_filter",
"uniform_filter1d",
"value_indices",
"variance",
"watershed_ift",
"white_tophat",
"zoom",
]
165 changes: 0 additions & 165 deletions scipy-stubs/ndimage/_dispatchers.pyi

This file was deleted.

Loading

0 comments on commit 4b78a5c

Please sign in to comment.