Skip to content

Commit

Permalink
STY: pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
klauer committed Sep 29, 2020
1 parent e031879 commit d544f16
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 145 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
ignore = E226,E741,W504
exclude = .git,__pycache__
max-line-length = 115
22 changes: 13 additions & 9 deletions hxrsnd/aerotech.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
import os

import numpy as np
from ophyd import Component as Cmp, FormattedComponent as FrmCmp
from ophyd.utils import LimitError
from ophyd import Component as Cmp
from ophyd import FormattedComponent as FrmCmp
from ophyd.signal import EpicsSignal, EpicsSignalRO, Signal
from ophyd.status import wait as status_wait
from ophyd.utils import LimitError

from .sndmotor import SndEpicsMotor
from .exceptions import (BadN2Pressure, MotorDisabled, MotorFaulted,
MotorStopped)
from .pneumatic import PressureSwitch
from .sndmotor import SndEpicsMotor
from .utils import absolute_submodule_path, as_list, stop_on_keyboardinterrupt
from .exceptions import MotorDisabled, MotorFaulted, MotorStopped, BadN2Pressure

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -283,7 +285,8 @@ def mv(self, position, wait=True, print_move=True,
if wait:
logger.info("Move completed for '{0}'.".format(self.desc))
else:
logger.info("Move command sent to '{0}'.".format(self.desc))
logger.info(
"Move command sent to '{0}'.".format(self.desc))
return status

# Catch all the common motor exceptions
Expand Down Expand Up @@ -613,7 +616,8 @@ def expert_screen(self, print_msg=True):
print_msg : bool, optional
Prints that the screen is being launched.
"""
path = absolute_submodule_path("hxrsnd/screens/motor_expert_screens.sh")
path = absolute_submodule_path(
"hxrsnd/screens/motor_expert_screens.sh")
if print_msg:
logger.info("Launching expert screen.")
os.system("{0} {1} {2} &".format(path, self.prefix, "aerotech"))
Expand Down Expand Up @@ -653,12 +657,12 @@ def status(self, status="", offset=0, print_status=True, newline=False,
status += "{0}Faulted: {1:>20}\n".format(" "*(offset+2),
str(self.faulted))
status += "{0}State: {1:>22}\n".format(" "*(offset+2),
str(self.state))
str(self.state))
status += "{0}Position: {1:>19}\n".format(" "*(offset+2),
np.round(self.wm(), 6))
status += "{0}Dial: {1:>23}\n".format(" "*(offset+2),
np.round(self.dial.get(),
6))
np.round(self.dial.get(),
6))
status += "{0}Limits: {1:>21}\n".format(
" "*(offset+2), str((int(self.low_limit),
int(self.high_limit))))
Expand Down
4 changes: 2 additions & 2 deletions hxrsnd/attocube.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ def mv(self, position, print_move=True, wait=None,
logger.warning("Cannot move - motor {0} is currently faulted. Try "
"running 'motor.clear()'.".format(self.desc))


def check_status(self, position=None):
"""
Checks the status of the motor to make sure it is ready to move. Checks
Expand Down Expand Up @@ -481,7 +480,8 @@ def expert_screen(self, print_msg=True):
Prints that the screen is being launched.
"""
# Get the absolute path to the screen
path = absolute_submodule_path("hxrsnd/screens/motor_expert_screens.sh")
path = absolute_submodule_path(
"hxrsnd/screens/motor_expert_screens.sh")
if print_msg:
logger.info("Launching expert screen.")
os.system("{0} {1} {2} &".format(path, self.prefix, "attocube"))
Expand Down
Loading

0 comments on commit d544f16

Please sign in to comment.