diff --git a/src/scanspec/plot.py b/src/scanspec/plot.py index 44483655..0b80c6ed 100644 --- a/src/scanspec/plot.py +++ b/src/scanspec/plot.py @@ -44,12 +44,12 @@ def __init__( self._verts3d = xs, ys, zs # Added here because of https://github.com/matplotlib/matplotlib/issues/21688 - def do_3d_projection(self, renderer: Any = None): + def do_3d_projection(self, renderer: Any = None): # type: ignore xs3d, ys3d, zs3d = self._verts3d xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, self.axes.M) # type: ignore - self.set_positions((xs[0], ys[0]), (xs[1], ys[1])) + self.set_positions((xs[0], ys[0]), (xs[1], ys[1])) # type: ignore - return np.min(zs) + return np.min(zs) # type: ignore @property def verts3d( diff --git a/src/scanspec/service.py b/src/scanspec/service.py index dcf152ed..b31f907c 100644 --- a/src/scanspec/service.py +++ b/src/scanspec/service.py @@ -338,7 +338,7 @@ def _sub_sample(frames: Frames[str], ratio: float) -> Frames[str]: return frames.extract(indexes, calculate_gap=False) -def _calc_smallest_step(points: list[npt.NDArray[np.float64]]) -> float: +def _calc_smallest_step(points: list[npt.NDArray[np.number[Any]]]) -> float: # Calc abs diffs of all axes, ignoring any zero values absolute_diffs = [_abs_diffs(axis_midpoints) for axis_midpoints in points] # Normalize and remove zeros diff --git a/src/scanspec/specs.py b/src/scanspec/specs.py index 3f4bd0c8..792ff4c7 100644 --- a/src/scanspec/specs.py +++ b/src/scanspec/specs.py @@ -450,7 +450,9 @@ def calculate( # noqa: D102 def _dimensions_from_indexes( - func: Callable[[npt.NDArray[np.float64]], dict[Axis, npt.NDArray[np.float64]]], + func: Callable[ + [npt.NDArray[np.floating[Any]]], dict[Axis, npt.NDArray[np.floating[Any]]] + ], axes: list[Axis], num: int, bounds: bool, @@ -496,8 +498,8 @@ def axes(self) -> list[Axis]: # noqa: D102 return [self.axis] def _line_from_indexes( - self, indexes: npt.NDArray[np.float64] - ) -> dict[Axis, npt.NDArray[np.float64]]: + self, indexes: npt.NDArray[np.floating[Any]] + ) -> dict[Axis, npt.NDArray[np.floating[Any]]]: if self.num == 1: # Only one point, stop-start gives length of one point step = self.stop - self.start @@ -586,8 +588,8 @@ def axes(self) -> list[Axis]: # noqa: D102 return [self.axis] def _repeats_from_indexes( - self, indexes: npt.NDArray[np.float64] - ) -> dict[Axis, npt.NDArray[np.float64]]: + self, indexes: npt.NDArray[np.floating[Any]] + ) -> dict[Axis, npt.NDArray[np.floating[Any]]]: return {self.axis: np.full(len(indexes), self.value)} def calculate( # noqa: D102 @@ -633,8 +635,8 @@ def axes(self) -> list[Axis]: # noqa: D102 return [self.y_axis, self.x_axis] def _spiral_from_indexes( - self, indexes: npt.NDArray[np.float64] - ) -> dict[Axis, npt.NDArray[np.float64]]: + self, indexes: npt.NDArray[np.floating[Any]] + ) -> dict[Axis, npt.NDArray[np.floating[Any]]]: # simplest spiral equation: r = phi # we want point spacing across area to be the same as between rings # so: sqrt(area / num) = ring_spacing