diff --git a/src/ophyd_async/core/__init__.py b/src/ophyd_async/core/__init__.py index 9eb23c3366..fe95335a8d 100644 --- a/src/ophyd_async/core/__init__.py +++ b/src/ophyd_async/core/__init__.py @@ -1,4 +1,5 @@ """The building blocks for making devices.""" +from typing import TYPE_CHECKING from ._detector import ( DetectorController, @@ -72,7 +73,6 @@ Reference, StrictEnum, SubsetEnum, - T, WatcherUpdate, gather_dict, get_dtype, @@ -170,7 +170,6 @@ "NotConnected", "Reference", "Table", - "T", "WatcherUpdate", "gather_dict", "get_dtype", diff --git a/src/ophyd_async/core/_signal_backend.py b/src/ophyd_async/core/_signal_backend.py index a65a2e6a25..d54e731bdc 100644 --- a/src/ophyd_async/core/_signal_backend.py +++ b/src/ophyd_async/core/_signal_backend.py @@ -7,7 +7,7 @@ from event_model import DataKey, Dtype, Limits from ._table import Table -from ._utils import Callback, StrictEnum, T +from ._utils import Callback, StrictEnum DTypeScalar_co = TypeVar("DTypeScalar_co", covariant=True, bound=np.generic) # To be a 1D array shape should really be tuple[int], but np.array() @@ -82,7 +82,7 @@ async def get_setpoint(self) -> SignalDatatypeT: """The point that a signal was requested to move to.""" @abstractmethod - def set_callback(self, callback: Callback[T] | None) -> None: + def set_callback(self, callback: Callback[Reading[SignalDatatypeT]] | None) -> None: """Observe changes to the current value, timestamp and severity""" diff --git a/src/ophyd_async/plan_stubs/_settings.py b/src/ophyd_async/plan_stubs/_settings.py index aeeb71e259..06668ac4aa 100644 --- a/src/ophyd_async/plan_stubs/_settings.py +++ b/src/ophyd_async/plan_stubs/_settings.py @@ -13,11 +13,11 @@ Settings, SettingsProvider, SignalRW, - T, walk_rw_signals, ) from ophyd_async.core._table import Table +from ._utils import T from ._wait_for_awaitable import wait_for_awaitable diff --git a/src/ophyd_async/plan_stubs/_utils.py b/src/ophyd_async/plan_stubs/_utils.py new file mode 100644 index 0000000000..afe45c23ef --- /dev/null +++ b/src/ophyd_async/plan_stubs/_utils.py @@ -0,0 +1,3 @@ +from typing import TypeVar + +T = TypeVar("T") \ No newline at end of file diff --git a/src/ophyd_async/plan_stubs/_wait_for_awaitable.py b/src/ophyd_async/plan_stubs/_wait_for_awaitable.py index e1d0dd2e65..c1d8c09b2b 100644 --- a/src/ophyd_async/plan_stubs/_wait_for_awaitable.py +++ b/src/ophyd_async/plan_stubs/_wait_for_awaitable.py @@ -3,7 +3,7 @@ import bluesky.plan_stubs as bps from bluesky.utils import MsgGenerator, plan -from ophyd_async.core import T +from ._utils import T @plan diff --git a/src/ophyd_async/testing/_assert.py b/src/ophyd_async/testing/_assert.py index b218c56629..3a8375b0e6 100644 --- a/src/ophyd_async/testing/_assert.py +++ b/src/ophyd_async/testing/_assert.py @@ -13,11 +13,12 @@ AsyncReadable, SignalDatatypeT, SignalR, - T, Table, + WatchableAsyncStatus, Watcher, ) -from ophyd_async.core._status import WatchableAsyncStatus + +from ._utils import T def approx_value(value: Any): diff --git a/src/ophyd_async/testing/_utils.py b/src/ophyd_async/testing/_utils.py new file mode 100644 index 0000000000..afe45c23ef --- /dev/null +++ b/src/ophyd_async/testing/_utils.py @@ -0,0 +1,3 @@ +from typing import TypeVar + +T = TypeVar("T") \ No newline at end of file