Skip to content

Commit

Permalink
alias
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jun 21, 2024
1 parent f20d01f commit 5f966db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"sphinxext.opengraph",
]

autodoc_type_aliases = {"npt.ArrayLike": "numpy.typing.ArrayLike"}

intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

# The suffix(es) of source filenames.
Expand Down
8 changes: 4 additions & 4 deletions src/PIL/ImageFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import abc
import functools
from types import GenericAlias, ModuleType
from types import ModuleType
from typing import TYPE_CHECKING, Any, Callable, Sequence, cast

if TYPE_CHECKING:
from numpy.typing import NDArray
import numpy.typing as npt

from . import _imaging

Expand Down Expand Up @@ -373,7 +373,7 @@ class Color3DLUT(MultibandFilter):
def __init__(
self,
size: int | tuple[int, int, int],
table: Sequence[float] | Sequence[Sequence[int]] | whatever,
table: Sequence[float] | Sequence[Sequence[int]] | npt.NDArray[Any],
channels: int = 3,
target_mode: str | None = None,
**kwargs: bool,
Expand All @@ -399,7 +399,7 @@ def __init__(
pass

if numpy and isinstance(table, numpy.ndarray):
numpy_table: NDArray[Any] = table
numpy_table: npt.NDArray[Any] = table
if copy_table:
numpy_table = numpy_table.copy()

Expand Down

0 comments on commit 5f966db

Please sign in to comment.