Skip to content

Commit

Permalink
User input instead of args to allow for easier bat file creation (#15080
Browse files Browse the repository at this point in the history
)

Converted arguments to user inputs to allow for easier bat file creation
for scripts that are used often.
  • Loading branch information
rclarke0 authored and Carlos-fernandez committed Jun 3, 2024
1 parent 0a3940f commit 48d76b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,10 @@ def upload_calibration_offsets(
parser.add_argument(
"email", metavar="EMAIL", type=str, nargs=1, help="opentrons gmail."
)
parser.add_argument(
"ip_or_all",
metavar="IP_OR_ALL",
type=str,
nargs=1,
help="Enter 'ALL' to read IPs.json or type full IP address of 1 robot.",
)
args = parser.parse_args()
storage_directory = args.storage_directory[0]
folder_name = args.folder_name[0]
google_sheet_name = args.google_sheet_name[0]
ip_or_all = args.ip_or_all[0]
email = args.email[0]
# Connect to google drive.
try:
Expand All @@ -191,6 +183,7 @@ def upload_calibration_offsets(
except FileNotFoundError:
print(f"Add .json file with robot IPs to: {storage_directory}.")
sys.exit()
ip_or_all = input("IP Address or ALL: ")

if ip_or_all == "ALL":
ip_address_list = ip_file["ip_address_list"]
Expand Down
22 changes: 3 additions & 19 deletions abr-testing/abr_testing/tools/abr_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,7 @@
nargs=1,
help="Name of google sheet and local csv to save data to.",
)
parser.add_argument("robot", metavar="ROBOT", type=str, nargs=1, help="Robot name.")
parser.add_argument(
"labware_name",
metavar="LABWARE_NAME",
type=str,
nargs=1,
help="Name of labware.",
)
parser.add_argument(
"protocol_step",
metavar="PROTOCOL_STEP",
type=str,
nargs=1,
help="1 for empty plate, 2 for filled plate, 3 for end of protocol.",
)
args = parser.parse_args()
robot = args.robot[0]
labware = args.labware_name[0]
protocol_step = args.protocol_step[0]
storage_directory = args.storage_directory[0]
file_name = args.file_name[0]
file_name_csv = file_name + ".csv"
Expand Down Expand Up @@ -71,7 +53,9 @@
print("Connected to google sheet.")
except FileNotFoundError:
print("No google sheets credentials. Add credentials to storage notebook.")

robot = input("Robot: ")
labware = input("Labware: ")
protocol_step = input("Measurement Step (1,2,3): ")
# Scale Loop
grams, is_stable = scale.read_mass()
grams, is_stable = scale.read_mass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, robot: str, duration: int, frequency: int) -> None:
test_name = "ABR-Environment-Monitoring"
run_id = data.create_run_id()
file_name = data.create_file_name(test_name, run_id, robot)
sensor = asair_sensor.BuildAsairSensor(False, True)
sensor = asair_sensor.BuildAsairSensor(False, False)
print(sensor)
env_data = sensor.get_reading()
header = [
Expand Down

0 comments on commit 48d76b1

Please sign in to comment.