Skip to content

Commit

Permalink
DOC: code-spell
Browse files Browse the repository at this point in the history
  • Loading branch information
rpartzsch committed Oct 28, 2024
1 parent 3acd0cf commit 604bad8
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 21 deletions.
File renamed without changes.
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The step size of a specific stage is given in um for translation stages and deg
|---------|-------------|-----------|-----------|-----------|
| `init` | `Init.` | Initialize motor stage. Powering and resetting the motor. Set motor move speed in the PIStageInterface.py function.| motor_name (str): name of the motorstage | - |
| `move` | `Input rel.` | Moves the motor stage a relative amount, positive values for ahead, negatives for back. Accepts string inputs with units (4cm, -2mm...). If no unit is given, the motor moves the default unit amount. | motor_name (str): name of the motorstage | a (str): Move amount |
| `moveto` | `input abs.` | Moves the motor stage to a absolut position. Accepts string inputs with units (4cm, -2mm...). If no unit is given, the motor moves to the default position unit. | motor_name (str): name of the motorstage |a (str): Move to position |
| `moveto` | `input abs.` | Moves the motor stage to an absolute position. Accepts string inputs with units (4cm, -2mm...). If no unit is given, the motor moves to the default position unit. | motor_name (str): name of the motorstage |a (str): Move to position |
| `pos` | - | Logs the current position of the motor stage.| motor_name (str): name of the motorstage | -|
| `stop` | `Stop` | Immediately stops all movement of the stage | motor_name (str): name of the motorstage | - |
| `sethome` | `Set Zero` | Sets the current position of the stage as new origin | motor_name (str): name of the motorstage | - |
Expand Down
24 changes: 12 additions & 12 deletions motor_stage_ui/PIStagesInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PIStagesInterface:
def __init__(
self,
port: str,
baud_rate: int = "9600",
baud_rate: int = 9600,
parity: str = "N",
terminator: str = "\r",
timeout: float = 2,
Expand Down Expand Up @@ -115,7 +115,7 @@ def init_motor(self, address: int, logic: str = None) -> None:
self.set_velocity(address, self.velocity)
time.sleep(0.1)

logging.info("Inititialized motorstage with address: %i" % address)
logging.info("Initialized motorstage with address: %i" % address)

def motor_on(self, address=None):
self._write_command("MN", address)
Expand Down Expand Up @@ -154,7 +154,7 @@ def set_home(self, address: int) -> None:
self.log.info("Set Home for motorstage with address: %i" % (address))

def go_home(self, address: int) -> None:
"""Moves the motorstage to the absolut zero position.
"""Moves the motorstage to the absolute zero position.
Args:
address (int): Address of the motorstage
Expand All @@ -177,14 +177,14 @@ def move_to_position(
"""Moves the motor stage absolute position.
Accepts string inputs with units (4cm, -2mm...). If no unit is given, the motor moves the default unit amount.
The unit inputs are converted using the pint package into the according motor controller steps.
Carefull stepsize depends on motorstage and powering. Deviations can also occure from weight on stage usw.
Careful stepsize depends on motorstage and powering. Deviations can also occur from weight on stage usw.
Args:
address (int): Address of the motorstage
amount (str): absolute position
unit (str): input unit
stage (int): stage type eather 'rotation' or translation
step_size (float): step size of the motorstage given in deg or um respectivly
stage (int): stage type either 'rotation' or translation
step_size (float): step size of the motorstage given in deg or um respectively
"""
try:
if amount != "" and stage in ["translation", "rotation"]:
Expand All @@ -201,14 +201,14 @@ def move_relative(
"""Moves the motor stage relative amount, positive values for ahead, negatives for back.
Accepts string inputs with units (4cm, -2mm...). If no unit is given, the motor moves the default unit amount.
The unit inputs are converted using the pint package into the according motor controller steps.
Carefull stepsize depends on motorstage and powering. Deviations can also occure from weight on stage usw.
Careful stepsize depends on motorstage and powering. Deviations can also occur from weight on stage usw.
Args:
address (int): Address of the motorstage
amount (str): absolute position
unit (str): input unit
stage (int): stage type eather 'rotation' or translation
step_size (float): step size of the motorstage given in deg or um respectivly
stage (int): stage type either 'rotation' or translation
step_size (float): step size of the motorstage given in deg or um respectively
"""
try:
if amount != "" and stage in ["translation", "rotation"]:
Expand All @@ -227,11 +227,11 @@ def get_position(
Args:
address (int): Address of the motorstage
unit (str): output unit
stage (int): stage type eather 'rotation' or translation
step_size (int): step size of the motorstage given in deg or um respectivly
stage (int): stage type either 'rotation' or translation
step_size (int): step size of the motorstage given in deg or um
Returns:
str: current position of motorstage in unit 3 digits precision
str: current position of motorstage in unit 3 digits precision respectively
"""
if stage in ["translation", "rotation"]:
if stage == "translation":
Expand Down
6 changes: 3 additions & 3 deletions motor_stage_ui/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ x_axis:
step_size: 0.018
unit: mm
port: '/dev/ttyUSB0'
baud_rate: '9600'
baud_rate: 9600

y_axis:
stage_type: translation
address: 2
step_size: 0.018
unit: mm
port: '/dev/ttyUSB0'
baud_rate: '9600'
baud_rate: 9600

rot:
stage_type: rotation
address: 3
step_size: 34e-06
unit: deg
port: '/dev/ttyUSB0'
baud_rate: '9600'
baud_rate: 9600
2 changes: 1 addition & 1 deletion motor_stage_ui/motor_stage_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def position_setting(
""" Draw GUI """

def labels(self):
"""Draws lables above motorstage buttons."""
"""Draws labels above motorstage buttons."""
label = QLabel("Motor", self)
label.setAlignment(Qt.AlignCenter)
label.resize(100, 20)
Expand Down
4 changes: 2 additions & 2 deletions motor_stage_ui/motor_stage_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def motor(conf):
(also in basil).
Args:
conf (str): Needs path to configuration yaml. This path is convertet into a click object and passed to the individual functions.
conf (str): Needs path to configuration yaml. This path is converted into a click object and passed to the individual functions.
"""

conf.ensure_object(dict)
Expand Down Expand Up @@ -77,7 +77,7 @@ def move(conf, motor_name: str, a: str):
@click.argument("motor_name")
@click.option("-a", default="0", help="move value")
def moveto(conf, motor_name: str, a: str):
"""Moves the motor stage to a absolut position.
"""Moves the motor stage to a absolute position.
Accepts string inputs with units (4cm, -2mm...). If no unit is given, the motor moves to the default position unit.
Args:
Expand Down

0 comments on commit 604bad8

Please sign in to comment.