9
9
import os
10
10
11
11
12
-
13
-
14
-
15
12
def _get_user_input (lst : List [str ], some_string : str ) -> str :
16
13
variable = input (some_string )
17
14
while variable not in lst :
@@ -24,27 +21,20 @@ def _get_user_input(lst: List[str], some_string: str) -> str:
24
21
25
22
class _ABRAsairSensor :
26
23
def __init__ (self , robot : str , duration : int , frequency : int ) -> None :
27
- var = _get_user_input (["C" , "R" ], "Running on computer (C) or robot (R)? " )
28
- if var == "R" :
29
- try :
30
- sys .path .insert (0 , "/var/lib/jupyter/notebooks" )
31
- import google_sheets_tool # type: ignore[import]
32
- credentials_path = "/var/lib/jupyter/notebooks/abr.json"
33
- except ImportError :
34
- from hardware_testing import google_sheets_tool
35
- raise ImportError (
36
- "Run on robot. Make sure google_sheets_tool.py is in jupyter notebook."
37
- )
38
- else :
39
- from hardware_testing import google_sheets_tool
40
- #credentials_path = "/hardware-testing/hardware_testing/abr.json"
41
- credentials_path = "C:/Users/Rhyann Clarke/opentrons/hardware-testing/hardware_testing/abr.json"
42
-
24
+ try :
25
+ sys .path .insert (0 , "/var/lib/jupyter/notebooks" )
26
+ import google_sheets_tool # type: ignore[import]
27
+
28
+ credentials_path = "/var/lib/jupyter/notebooks/abr.json"
29
+ except ImportError :
30
+ raise ImportError (
31
+ "Run on robot. Make sure google_sheets_tool.py is in jupyter notebook."
32
+ )
43
33
print (os .path .exists (credentials_path ))
44
34
test_name = "ABR-Environment-Monitoring"
45
35
run_id = data .create_run_id ()
46
36
file_name = data .create_file_name (test_name , run_id , robot )
47
- sensor = asair_sensor .BuildAsairSensor (False , False )
37
+ sensor = asair_sensor .BuildAsairSensor (False , True )
48
38
print (sensor )
49
39
env_data = sensor .get_reading ()
50
40
header = [
@@ -58,7 +48,6 @@ def __init__(self, robot: str, duration: int, frequency: int) -> None:
58
48
header_str = "," .join (header ) + "\n "
59
49
data .append_data_to_file (test_name , run_id , file_name , header_str )
60
50
# Upload to google has passed
61
-
62
51
try :
63
52
google_sheet = google_sheets_tool .google_sheet (
64
53
credentials_path , "ABR Ambient Conditions" , tab_number = 0
@@ -132,7 +121,7 @@ def __init__(self, robot: str, duration: int, frequency: int) -> None:
132
121
"PVT1ABR10" ,
133
122
"PVT1ABR11" ,
134
123
"PVT1ABR12" ,
135
- "ROOM_339" ,
124
+ "ROOM_339" ,
136
125
"Room_340" ,
137
126
] # type: List
138
127
robot = _get_user_input (robot_list , "Robot/Room: " )
0 commit comments