Skip to content

Commit c26c549

Browse files
alexfiklinducer
authored andcommitted
tools: fix sphinx type annotation errors
1 parent 068a740 commit c26c549

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
}
3030

3131
nitpick_ignore_regex = [
32-
["py:class", r"symengine\.(.+)"], # :cry:
33-
]
32+
["py:class", r"symengine\.(.+)"], # :cry:
33+
]

sumpy/tools.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333

3434
import loopy as lp
3535
import numpy as np
36-
from arraycontext import Array
3736
from pymbolic.mapper import WalkMapper
38-
from pytools import T, memoize_method
37+
from pytools import memoize_method
3938
from pytools.tag import Tag, tag_dataclass
4039

4140
import sumpy.symbolic as sym
4241

4342
if TYPE_CHECKING:
44-
import pyopencl as cl
43+
import numpy
44+
import pyopencl
4545

4646
from sumpy.kernel import Kernel
4747

@@ -91,6 +91,7 @@
9191
.. autofunction:: matvec_toeplitz_upper_triangular
9292
9393
.. autoclass:: FFTBackend
94+
:members:
9495
.. autofunction:: loopy_fft
9596
.. autofunction:: get_opencl_fft_app
9697
.. autofunction:: run_opencl_fft
@@ -134,8 +135,8 @@ def mi_set_axis(mi: Sequence[int], axis: int, value: int) -> Tuple[int, ...]:
134135

135136

136137
def mi_power(
137-
vector: Sequence[T], mi: Sequence[int],
138-
evaluate: bool = True) -> T:
138+
vector: Sequence[Any], mi: Sequence[int],
139+
evaluate: bool = True) -> Any:
139140
result = 1
140141
for mi_i, vec_i in zip(mi, vector):
141142
if mi_i == 1:
@@ -283,7 +284,7 @@ def __init__(self, ctx: Any,
283284
target_kernels: List["Kernel"],
284285
source_kernels: List["Kernel"],
285286
strength_usage: Optional[List[int]] = None,
286-
value_dtypes: Optional[List["np.dtype[Any]"]] = None,
287+
value_dtypes: Optional[List["numpy.dtype[Any]"]] = None,
287288
name: Optional[str] = None,
288289
device: Optional[Any] = None) -> None:
289290
"""
@@ -886,7 +887,7 @@ class FFTBackend(enum.Enum):
886887
loopy = 2
887888

888889

889-
def _get_fft_backend(queue: "cl.CommandQueue") -> FFTBackend:
890+
def _get_fft_backend(queue: "pyopencl.CommandQueue") -> FFTBackend:
890891
import os
891892

892893
env_val = os.environ.get("SUMPY_FFT_BACKEND")
@@ -927,9 +928,9 @@ def _get_fft_backend(queue: "cl.CommandQueue") -> FFTBackend:
927928

928929

929930
def get_opencl_fft_app(
930-
queue: "cl.CommandQueue",
931+
queue: "pyopencl.CommandQueue",
931932
shape: Tuple[int, ...],
932-
dtype: "np.dtype[Any]",
933+
dtype: "numpy.dtype[Any]",
933934
inverse: bool) -> Any:
934935
"""Setup an object for out-of-place FFT on with given shape and dtype
935936
on given queue.
@@ -951,10 +952,10 @@ def get_opencl_fft_app(
951952

952953
def run_opencl_fft(
953954
fft_app: Tuple[Any, FFTBackend],
954-
queue: "cl.CommandQueue",
955-
input_vec: Array,
955+
queue: "pyopencl.CommandQueue",
956+
input_vec: Any,
956957
inverse: bool = False,
957-
wait_for: List["cl.Event"] = None) -> Tuple["cl.Event", Array]:
958+
wait_for: List["pyopencl.Event"] = None) -> Tuple["pyopencl.Event", Any]:
958959
"""Runs an FFT on input_vec and returns a :class:`MarkerBasedProfilingEvent`
959960
that indicate the end and start of the operations carried out and the output
960961
vector.

0 commit comments

Comments
 (0)