Skip to content

Commit

Permalink
mypy linting
Browse files Browse the repository at this point in the history
  • Loading branch information
vegano1 committed Apr 7, 2023
1 parent d20dd0f commit 263a001
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions hardware-testing/hardware_testing/scripts/module_calibration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""OT-3 Module Calibration Script."""
import argparse
from traceback import print_exc
import requests
Expand Down Expand Up @@ -33,15 +34,16 @@
PARAMS = {"waitUntilComplete": "true"}


def home_z(ip_addr: str) -> None:
def _home_z(ip_addr: str) -> None:
"""Home the z axis for the instrument."""
# Home the instrument axis so we are at a known state
print(f"Homing z axis")
print("Homing z axis")
home_z = {"data": {"commandType": "home", "params": {"axes": ["leftZ", "rightZ"]}}}
url = f"{BASE_URL.format(ip_addr)}/commands"
requests.post(headers=HEADERS, url=url, json=home_z, params=PARAMS)


def main(args: argparse.Namespace) -> None:
def _main(args: argparse.Namespace) -> None:
base_url = f"{BASE_URL.format(args.host)}"

# create an empty run
Expand All @@ -51,7 +53,7 @@ def main(args: argparse.Namespace) -> None:
print(f"Created run {run_id}")

# Home the instrument axis so we are at a known state
home_z(args.host)
_home_z(args.host)

# load the module based on the model
print(f"Loading the module {args.model} at slot {args.slot}")
Expand Down Expand Up @@ -132,9 +134,9 @@ def main(args: argparse.Namespace) -> None:
)
args = parser.parse_args()
try:
main(args)
_main(args)
except Exception:
print(f"Unhandlaed exception")
print("Unhandled exception")
print_exc()
finally:
home_z(args.host)
_home_z(args.host)

0 comments on commit 263a001

Please sign in to comment.