Open evalott100 opened 4 months ago
Here's the relevant blueapi issue https://github.com/DiamondLightSource/blueapi/issues/553
My knee-jerk reaction is to make just the errors public as they can be raised out the the RE (or catch them and re-raise errors of a different type) and to have blueapi import the private modules if the only usage is for typing.
I'm not sure what right way to type things using the descriptor protocol (that is Python's descriptors not the event models) as the type of the attribute on the class object is what ever the descriptor class is but the type on an instance of the class is going to be a different type as a core feature of their functionality. Maybe we need to add another Protocol
class? I do not think we want the detail that we are using a version of super_state_machine to be public so we should pare that back as far as we can.
Super state machine lacks support, and as such we've decided to vendor it within bluesky, keeping it private for convenience.
In ophyd-async, we except
TransitionError
in tests requiring theRunEngine
, but this can be imported fromRunEngine
directly.Blueapi uses
ProxyMachine
in typing, which isn't available throughbluesky.run_engine
:https://github.com/DiamondLightSource/blueapi/blob/97b43cec747b22c94de266e05db286ba98f81aba/src/blueapi/worker/event.py#L10-L11
I would suggest:
Change
bluesky._vendor.super_state_machine
tobluesky.vendor.super_state_machine
, with an__init__.py
exposing the relevant public members.@tacaswell @danielballan