Skip to content

Commit da14fdd

Browse files
committed
Register LinkamBase as a FloatingDeviceMixin instead of LinkamCMS
FloatingDeviceMixin is an ABC that requires get_id. This is implemented in LinkamBase and not on LinkamCMS. Also, mixins need to appear before base classes to have the MRO done in the right order. LinkamCMS had the FloatingDeviceMixin last on the MRO to work around this (list FloatingDeviceMixin before LinkamBase would have get_id call the empty implementation on the mixin only). This change also gets a correct MRO.
1 parent 6f74063 commit da14fdd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

microscope/stages/linkam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ def __getattribute__(self, name):
900900
}
901901

902902

903-
class LinkamBase(devices.Device):
903+
class LinkamBase(devices.FloatingDeviceMixin, devices.Device):
904904
"""Base class for connecting to Linkam SDK devices.
905905
906906
This class deals with SDK initialisation and setting callbacks to
@@ -1260,7 +1260,7 @@ def get_position(self):
12601260
return pos
12611261

12621262

1263-
class LinkamCMS(LinkamMDSMixin, LinkamBase, devices.FloatingDeviceMixin):
1263+
class LinkamCMS(LinkamMDSMixin, LinkamBase):
12641264
"""Linkam correlative-microscopy stage."""
12651265
_refill_map = {'sample': 'sampleDewarFillSignal',
12661266
'external': 'mainDewarFillSignal'}

0 commit comments

Comments
 (0)