refactor: properly order imports

This commit is contained in:
2024-03-22 17:23:27 +01:00
parent 9e676fc532
commit d81139e0ff

View File

@ -19,7 +19,7 @@ class EpicsMotorRotationError(Exception):
class RotationDeviceMixin: class RotationDeviceMixin:
def __init__(self, *args, parent=None, **kwargs): def __init__(self, parent=None, **kwargs):
"""Mixin class to add rotation specific methods and properties. """Mixin class to add rotation specific methods and properties.
This class should not be used directly, but inherited by the children classes and implement the methods if needed. This class should not be used directly, but inherited by the children classes and implement the methods if needed.
Args: Args:
@ -32,7 +32,9 @@ class RotationDeviceMixin:
apply_mod360: Apply modulos 360 to the current position apply_mod360: Apply modulos 360 to the current position
get_valid_rotation_modes: Get valid rotation modes for the implemented motor get_valid_rotation_modes: Get valid rotation modes for the implemented motor
""" """
super().__init__(*args, parent=parent, **kwargs) super().__init__(parent=parent, **kwargs)
self.parent = parent
# pylint: disable=protected-access
self.parent._has_mod360 = False self.parent._has_mod360 = False
self.parent._has_freerun = False self.parent._has_freerun = False
self._valid_rotation_modes = [] self._valid_rotation_modes = []
@ -54,13 +56,14 @@ class RotationDeviceMixin:
class EpicsMotorRotationMixin(RotationDeviceMixin): class EpicsMotorRotationMixin(RotationDeviceMixin):
def __init__(self, *args, parent=None, **kwargs): def __init__(self, parent=None, **kwargs):
"""Mixin class implementing rotation specific functionality and parameter for EpicsMotorRecord. """Mixin class implementing rotation specific functionality and parameter for EpicsMotorRecord.
Args: Args:
parent: parent class should inherit from TomoRotationBase parent: parent class should inherit from TomoRotationBase
""" """
super().__init__(*args, parent=parent, **kwargs) super().__init__(parent=parent, **kwargs)
# pylint: disable=protected-access
self.parent._has_mod360 = True self.parent._has_mod360 = True
self.parent._has_freerun = True self.parent._has_freerun = True
self._valid_rotation_modes = ["target", "radiography"] self._valid_rotation_modes = ["target", "radiography"]
@ -99,7 +102,7 @@ class RotationBase:
for k, v in tomo_rotation_config.items(): for k, v in tomo_rotation_config.items():
self.tomo_config[k] = v self.tomo_config[k] = v
self.custom_prepare = self.custom_prepare_cls(parent=self) self.custom_prepare = self.custom_prepare_cls(parent=self, **kwargs)
super().__init__(name=name, **kwargs) super().__init__(name=name, **kwargs)
@property @property