Blackened files
This commit is contained in:
parent
be5ddb76ae
commit
4e7606aa0c
24 changed files with 200 additions and 120 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import numpy as np
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from openflexure_microscope.common.lock import StrictLock
|
||||
|
||||
|
|
@ -110,4 +111,4 @@ class BaseStage(metaclass=ABCMeta):
|
|||
array of 3D positions with x=y=0. This, along with all the
|
||||
keyword arguments, is then passed to ``scan_linear``.
|
||||
"""
|
||||
return self.scan_linear([[0, 0, z] for z in dz], **kwargs)
|
||||
return self.scan_linear([[0, 0, z] for z in dz], **kwargs)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from collections.abc import Iterable
|
|||
import numpy as np
|
||||
import time
|
||||
|
||||
|
||||
class MockStage(BaseStage):
|
||||
def __init__(self, port=None, **kwargs):
|
||||
BaseStage.__init__(self)
|
||||
|
|
@ -68,7 +69,9 @@ class MockStage(BaseStage):
|
|||
else:
|
||||
self._backlash = np.array([int(blsh)] * self.n_axes, dtype=np.int)
|
||||
|
||||
def move_rel(self, displacement: list, axis=None, backlash=True, simulate_time: bool=True):
|
||||
def move_rel(
|
||||
self, displacement: list, axis=None, backlash=True, simulate_time: bool = True
|
||||
):
|
||||
if simulate_time:
|
||||
time.sleep(1)
|
||||
if axis is not None:
|
||||
|
|
@ -81,7 +84,7 @@ class MockStage(BaseStage):
|
|||
|
||||
self._position = list(np.array(self._position) + np.array(move))
|
||||
|
||||
def move_abs(self, final, simulate_time: bool=True, **kwargs):
|
||||
def move_abs(self, final, simulate_time: bool = True, **kwargs):
|
||||
if simulate_time:
|
||||
time.sleep(1)
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class Sangaboard(ExtensibleSerialInstrument):
|
|||
# make sure we close the serial port cleanly (otherwise it hangs open).
|
||||
self.close()
|
||||
logging.error(e)
|
||||
logging.error(
|
||||
logging.warning(
|
||||
"You may need to update the firmware running on the Sangaboard."
|
||||
)
|
||||
raise e
|
||||
|
|
@ -164,12 +164,12 @@ class Sangaboard(ExtensibleSerialInstrument):
|
|||
r"OpenFlexure Motor Board v(([\d]+)(?:\.([\d]+))+)", self.firmware
|
||||
)
|
||||
if not match:
|
||||
logging.error(
|
||||
logging.warning(
|
||||
'Version string "{}" not recognised.'.format(self.firmware)
|
||||
)
|
||||
return False
|
||||
else:
|
||||
logging.error("No firmware version string was returned.")
|
||||
logging.warning("No firmware version string was returned.")
|
||||
return False
|
||||
|
||||
# Check for matching/valid version number
|
||||
|
|
@ -179,7 +179,7 @@ class Sangaboard(ExtensibleSerialInstrument):
|
|||
self.firmware_version = match.group(1)
|
||||
|
||||
if version_tuple not in Sangaboard.valid_firmwares:
|
||||
logging.error(
|
||||
logging.warning(
|
||||
"This version of the Python module requires firmware v0.5 (with legacy support for v0.4)"
|
||||
)
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue