Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making the scale script usable for robots not doing liquid measurement. #15628

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions abr-testing/abr_testing/tools/abr_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,29 @@ def get_protocol_step_as_int(
# create an dict copying the contents of IP_N_Volumes
try:
ip_file = json.load(open(ip_json_file))
try:
# grab IP and volume from the dict
tot_info = ip_file["information"]
robot_info = tot_info[robot]
IP_add = robot_info["IP"]
exp_volume = robot_info["volume"]
# sets return variables equal to those grabbed from the sheet
ip = IP_add
expected_liquid_moved = float(exp_volume)
except KeyError:
ip = input("Robot IP: ")
while True:
try:
expected_liquid_moved = float(input("Expected volume moved: "))
if expected_liquid_moved >= 0 or expected_liquid_moved <= 0:
break
except ValueError:
print("Expected liquid moved volume should be an float.")
except FileNotFoundError:
print(
f"Please add json file with robot IPs and expected volumes to: {storage_directory}."
)
sys.exit()
# grab IP and volume from the dict
tot_info = ip_file["information"]
robot_info = tot_info[robot]
IP_add = robot_info["IP"]
exp_volume = robot_info["volume"]
# sets return variables equal to those grabbed from the sheet
ip = IP_add
expected_liquid_moved = float(exp_volume)

return protocol_step, expected_liquid_moved, ip

Expand Down
Loading