diff --git a/.github/actions/install_requirements/action.yml b/.github/actions/install_requirements/action.yml index 25a146d16..ea3fafcba 100644 --- a/.github/actions/install_requirements/action.yml +++ b/.github/actions/install_requirements/action.yml @@ -36,7 +36,7 @@ runs: shell: bash - name: Upload lockfiles - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: lockfiles path: lockfiles diff --git a/examples/devices/counter.py b/examples/devices/counter.py index e52851a27..d765d8b49 100644 --- a/examples/devices/counter.py +++ b/examples/devices/counter.py @@ -23,8 +23,7 @@ class CounterDevice(Device): """A simple device which increments a value.""" #: An empty typed mapping of input values - class Inputs(TypedDict): - ... + class Inputs(TypedDict): ... #: A typed mapping containing the 'value' output value class Outputs(TypedDict): diff --git a/examples/devices/isolated_device.py b/examples/devices/isolated_device.py index a6f7d6413..95cb15abc 100644 --- a/examples/devices/isolated_device.py +++ b/examples/devices/isolated_device.py @@ -21,11 +21,9 @@ class IsolatedBoxDevice(Device): The device has no inputs or outputs and interacts solely through adapters. """ - class Inputs(TypedDict): - ... + class Inputs(TypedDict): ... - class Outputs(TypedDict): - ... + class Outputs(TypedDict): ... def __init__(self, initial_value: float = 2) -> None: """Constructor which configures the initial value diff --git a/examples/devices/remote_controlled.py b/examples/devices/remote_controlled.py index 50cacd2a0..54ea88420 100644 --- a/examples/devices/remote_controlled.py +++ b/examples/devices/remote_controlled.py @@ -22,8 +22,7 @@ class RemoteControlledDevice(Device): """A trivial toy device which is controlled by an adapter.""" #: An empty typed mapping of device inputs - class Inputs(TypedDict): - ... + class Inputs(TypedDict): ... #: A typed mapping containing the 'observed' output value class Outputs(TypedDict): diff --git a/examples/devices/trampoline.py b/examples/devices/trampoline.py index fa92b149e..f6febae99 100644 --- a/examples/devices/trampoline.py +++ b/examples/devices/trampoline.py @@ -16,12 +16,10 @@ class TrampolineDevice(Device): """A trivial toy device which requests a callback every update.""" #: An empty typed mapping of device inputs - class Inputs(TypedDict): - ... + class Inputs(TypedDict): ... #: An empty typed mapping of device outputs - class Outputs(TypedDict): - ... + class Outputs(TypedDict): ... def __init__(self, callback_period: int = int(1e9)) -> None: """A constructor of the sink which configures the device callback period. @@ -58,8 +56,7 @@ class RandomTrampolineDevice(Device): """A trivial toy device which produced a random output and requests a callback.""" #: An empty typed mapping of device inputs - class Inputs(TypedDict): - ... + class Inputs(TypedDict): ... #: A typed mapping containing the 'output' output value class Outputs(TypedDict): diff --git a/src/tickit/adapters/http.py b/src/tickit/adapters/http.py index 7fb4d5644..8ae95baf7 100644 --- a/src/tickit/adapters/http.py +++ b/src/tickit/adapters/http.py @@ -27,5 +27,4 @@ def get_endpoints(self) -> Iterable[Tuple[HttpEndpoint, Callable]]: if endpoint is not None and isinstance(endpoint, HttpEndpoint): yield endpoint, func - def after_update(self) -> None: - ... + def after_update(self) -> None: ... diff --git a/src/tickit/adapters/io/zeromq_push_io.py b/src/tickit/adapters/io/zeromq_push_io.py index e57601e13..9e053a6fa 100644 --- a/src/tickit/adapters/io/zeromq_push_io.py +++ b/src/tickit/adapters/io/zeromq_push_io.py @@ -21,8 +21,7 @@ @runtime_checkable class SocketFactory(Protocol): - async def __call__(self, __host: str, __port: int) -> aiozmq.ZmqStream: - ... + async def __call__(self, __host: str, __port: int) -> aiozmq.ZmqStream: ... async def create_zmq_push_socket(host: str, port: int) -> aiozmq.ZmqStream: diff --git a/src/tickit/adapters/tcp.py b/src/tickit/adapters/tcp.py index a22860461..3b9d9b937 100644 --- a/src/tickit/adapters/tcp.py +++ b/src/tickit/adapters/tcp.py @@ -56,8 +56,7 @@ class CommandAdapter(Interpreter[AnyStr]): def byte_format(self) -> ByteFormat: return self._byte_format - def after_update(self) -> None: - ... + def after_update(self) -> None: ... async def handle_message( self, diff --git a/src/tickit/adapters/zmq.py b/src/tickit/adapters/zmq.py index 67423b5dc..9ae4eaec2 100644 --- a/src/tickit/adapters/zmq.py +++ b/src/tickit/adapters/zmq.py @@ -31,8 +31,7 @@ def add_message_to_stream(self, message: ZeroMqMessage) -> None: async def next_message(self) -> ZeroMqMessage: return await self._ensure_queue().get() - def after_update(self) -> None: - ... + def after_update(self) -> None: ... def _ensure_queue(self) -> asyncio.Queue: if self._message_queue is None: diff --git a/src/tickit/core/adapter.py b/src/tickit/core/adapter.py index 3615b492d..f2bfc4cdd 100644 --- a/src/tickit/core/adapter.py +++ b/src/tickit/core/adapter.py @@ -22,8 +22,7 @@ class AdapterIo(ABC, Generic[A]): """Io logic with a setup method for an adapter object.""" @abstractmethod - async def setup(self, adapter: A, raise_interrupt: RaiseInterrupt) -> None: - ... + async def setup(self, adapter: A, raise_interrupt: RaiseInterrupt) -> None: ... class AdapterContainer(Generic[A]): diff --git a/src/tickit/core/management/schedulers/base.py b/src/tickit/core/management/schedulers/base.py index 257621b6e..f2198b9e4 100644 --- a/src/tickit/core/management/schedulers/base.py +++ b/src/tickit/core/management/schedulers/base.py @@ -120,9 +120,9 @@ async def setup(self) -> None: await self.state_consumer.subscribe( {output_topic(component) for component in self.ticker.components} ) - self.state_producer: StateProducer[ - Union[ComponentInput, Skip] - ] = self._state_producer_cls() + self.state_producer: StateProducer[Union[ComponentInput, Skip]] = ( + self._state_producer_cls() + ) def add_wakeup(self, component: ComponentID, when: SimTime) -> None: """Adds a wakeup to the mapping. diff --git a/src/tickit/devices/sink.py b/src/tickit/devices/sink.py index 1aeffc493..4592df6e3 100644 --- a/src/tickit/devices/sink.py +++ b/src/tickit/devices/sink.py @@ -19,8 +19,7 @@ class Inputs(TypedDict): input: Any #: An empty typed mapping of device outputs - class Outputs(TypedDict): - ... + class Outputs(TypedDict): ... def update(self, time: SimTime, inputs: Inputs) -> DeviceUpdate[Outputs]: """The update method which logs the inputs and produces no outputs. diff --git a/src/tickit/devices/source.py b/src/tickit/devices/source.py index 574e3218b..e3f53e969 100644 --- a/src/tickit/devices/source.py +++ b/src/tickit/devices/source.py @@ -15,8 +15,7 @@ class SourceDevice(Device): """A simple device which produces a pre-configured value.""" #: An empty typed mapping of device inputs - class Inputs(TypedDict): - ... + class Inputs(TypedDict): ... #: A typed mapping containing the 'value' output value class Outputs(TypedDict):