Commit 60c49a83 authored by Joel Collins's avatar Joel Collins
Browse files

Fixed setting Iterable vs Int backlash

parent 5e34b998
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
import numpy as np
import time
import logging
from collections.abc import Iterable
from .sangaboard import Sangaboard
from openflexure_microscope.stage.base import BaseStage

@@ -69,9 +71,13 @@ class SangaStage(BaseStage):

    @backlash.setter
    def backlash(self, blsh):
        logging.debug("Setting backlash to {}".format(blsh))
        if blsh is None:
            self._backlash = None
        elif isinstance(blsh, Iterable):
            assert len(blsh) == self.n_axes
            self._backlash = np.array(blsh)
        else:
            self._backlash = np.array([int(blsh)]*self.n_axes, dtype=np.int)

    def move_rel(self, displacement, axis=None, backlash=True):