From 7b4b9a07bfdee81c2f35cf1352f3e0eecc9c046a Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 19 Nov 2024 07:51:58 +0000 Subject: [PATCH] Be nitpicky --- doc/conf.py | 9 ++++++++- pyproject.toml | 3 +++ src/ibex_bluesky_core/devices/block.py | 2 +- src/ibex_bluesky_core/devices/simpledae/waiters.py | 12 ++++++------ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 5aba546..4d82a6d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -16,10 +16,17 @@ author = "ISIS Experiment Controls" release = "0.1" - # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration +nitpicky = True +nitpick_ignore_regex = [ + ("py:func", r"^(?!ibex_bluesky_core\.).*$"), + ("py:class", r"^(?!ibex_bluesky_core\.).*$"), + ("py:class", r"^.*\.T$"), + ("py:obj", r"^.*\.T$"), +] + myst_enable_extensions = ["dollarmath"] extensions = [ diff --git a/pyproject.toml b/pyproject.toml index f5b8a88..b1d25b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,3 +110,6 @@ reportUntypedClassDecorator = true reportUntypedFunctionDecorator = true [tool.setuptools_scm] + +[tool.build_sphinx] + diff --git a/src/ibex_bluesky_core/devices/block.py b/src/ibex_bluesky_core/devices/block.py index 93261cc..3ab87e8 100644 --- a/src/ibex_bluesky_core/devices/block.py +++ b/src/ibex_bluesky_core/devices/block.py @@ -21,7 +21,7 @@ logger = logging.getLogger(__name__) -"""Block data type""" +# Block data type T = TypeVar("T") diff --git a/src/ibex_bluesky_core/devices/simpledae/waiters.py b/src/ibex_bluesky_core/devices/simpledae/waiters.py index 1c034a7..258e870 100644 --- a/src/ibex_bluesky_core/devices/simpledae/waiters.py +++ b/src/ibex_bluesky_core/devices/simpledae/waiters.py @@ -22,7 +22,7 @@ T = TypeVar("T", int, float) -class _SimpleWaiter(Waiter, Generic[T], metaclass=ABCMeta): +class SimpleWaiter(Waiter, Generic[T], metaclass=ABCMeta): """Wait for a single DAE variable to be greater or equal to a specified numeric value.""" def __init__(self, value: T) -> None: @@ -47,10 +47,10 @@ def additional_readable_signals(self, dae: "SimpleDae") -> list[Device]: @abstractmethod def get_signal(self, dae: "SimpleDae") -> SignalR[T]: - pass + """Get the numeric signal to wait for.""" -class PeriodGoodFramesWaiter(_SimpleWaiter[int]): +class PeriodGoodFramesWaiter(SimpleWaiter[int]): """Wait for period good frames to reach a user-specified value.""" def get_signal(self, dae: "SimpleDae") -> SignalR[int]: @@ -58,7 +58,7 @@ def get_signal(self, dae: "SimpleDae") -> SignalR[int]: return dae.period.good_frames -class GoodFramesWaiter(_SimpleWaiter[int]): +class GoodFramesWaiter(SimpleWaiter[int]): """Wait for good frames to reach a user-specified value.""" def get_signal(self, dae: "SimpleDae") -> SignalR[int]: @@ -66,7 +66,7 @@ def get_signal(self, dae: "SimpleDae") -> SignalR[int]: return dae.good_frames -class GoodUahWaiter(_SimpleWaiter[float]): +class GoodUahWaiter(SimpleWaiter[float]): """Wait for good microamp-hours to reach a user-specified value.""" def get_signal(self, dae: "SimpleDae") -> SignalR[float]: @@ -74,7 +74,7 @@ def get_signal(self, dae: "SimpleDae") -> SignalR[float]: return dae.good_uah -class MEventsWaiter(_SimpleWaiter[float]): +class MEventsWaiter(SimpleWaiter[float]): """Wait for a user-specified number of millions of events.""" def get_signal(self, dae: "SimpleDae") -> SignalR[float]: