From b49ed30f6866db6dc7da379ef00348b9662361ef Mon Sep 17 00:00:00 2001 From: Callum Forrester Date: Mon, 16 Sep 2024 16:01:33 +0100 Subject: [PATCH] Fix docs build --- docs/conf.py | 1 + src/scanspec/core.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index acfda3be..4e376ee9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -72,6 +72,7 @@ # ('envvar', 'LD_LIBRARY_PATH'). nitpick_ignore = [ ("py:class", "scanspec.core.C"), + ("py:class", "scanspec.core.T"), ("py:class", "pydantic.config.ConfigDict"), ] diff --git a/src/scanspec/core.py b/src/scanspec/core.py index b216b99a..4a4edb69 100644 --- a/src/scanspec/core.py +++ b/src/scanspec/core.py @@ -189,7 +189,7 @@ def _make_schema( return {member.__name__: handler(member) for member in members} -def if_instance_do(x: C, cls: type[C], func: Callable[[C], T]): +def if_instance_do(x: C, cls: type[C], func: Callable[[C], T]) -> T: """If x is of type cls then return func(x), otherwise return NotImplemented. Used as a helper when implementing operator overloading. @@ -428,7 +428,7 @@ def from_frames( return cls(frames.midpoints, frames.lower, frames.upper, frames.gap) def extract( - self, indices: npt.NDArray[np.int32], calculate_gap: bool = True + self, indices: npt.NDArray[np.signedinteger[Any]], calculate_gap: bool = True ) -> Frames[Axis]: """Return a new Frames object restricted to the indices provided.