Skip to content

Commit 5fc81d6

Browse files
committed
FloatingDeviceMixin: expand docstring about its use case.
1 parent 9dde0b3 commit 5fc81d6

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

microscope/abc.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,21 @@ class FloatingDeviceMixin(metaclass=abc.ABCMeta):
192192
"""A mixin for devices that 'float'.
193193
194194
Some SDKs handling multiple devices do not allow for explicit
195-
selection of a specific device. Instead, a device must be
196-
initialized and then queried to determine its ID. This class is a
197-
mixin which identifies a subclass as floating, and enforces the
198-
implementation of a `get_id` method.
195+
selection of a specific device. Instead, when the SDK is
196+
initialised it assigns an index to each device. However, this
197+
index is only unique until the program ends and next time the
198+
program runs the device might be assigned a different index. This
199+
means that it is not possible to request a specific device to the
200+
SDK. Instead, one connects to one of the available devices, then
201+
initialises it, and only then can one check which one we got.
202+
203+
Floating devices are a problem in systems where there are multiple
204+
devices of the same type but we only want to initialise a subset
205+
of them. Make sure that a device really is a floating device
206+
before making use of this class. Avoid it if possible.
207+
208+
This class is a mixin which enforces the implementation of a
209+
`get_id` method, which typically returns the device serial number.
199210
200211
Args:
201212
index: the index of the device on a shared library. This

0 commit comments

Comments
 (0)