1717import numpy as np
1818from more_itertools import always_iterable
1919from numpy .random import RandomState
20+ from numpy .typing import NDArray
2021from unyt .exceptions import UnitOperationError
2122
2223from yt ._maintenance .deprecation import issue_deprecation_warning
@@ -91,7 +92,7 @@ def assert_rel_equal(a1, a2, decimals, err_msg="", verbose=True):
9192
9293# tested: volume integral is 1.
9394def cubicspline_python (
94- x : float | np .ndarray ,
95+ x : float | NDArray [ np .floating ] ,
9596) -> np .ndarray :
9697 """
9798 cubic spline SPH kernel function for testing against more
@@ -118,7 +119,9 @@ def cubicspline_python(
118119
119120
120121def integrate_kernel (
121- kernelfunc : Callable [[float ], float ], b : float , hsml : float
122+ kernelfunc : Callable [[float | NDArray [np .floating ]], float | NDArray [np .floating ]],
123+ b : float ,
124+ hsml : float ,
122125) -> float :
123126 """
124127 integrates a kernel function over a line passing entirely
@@ -154,11 +157,11 @@ def integrate_kernel(
154157
155158
156159def distancematrix (
157- pos3_i0 : np .ndarray ,
158- pos3_i1 : np .ndarray ,
160+ pos3_i0 : NDArray [ np .floating ] ,
161+ pos3_i1 : NDArray [ np .floating ] ,
159162 periodic : tuple [bool , bool , bool ] = (True ,) * 3 ,
160- periods : np .ndarray = _zeroperiods ,
161- ) -> np .ndarray :
163+ periods : NDArray [ np .floating ] = _zeroperiods ,
164+ ) -> NDArray [ np .floating ] :
162165 """
163166 Calculates the distances between two arrays of points.
164167
0 commit comments