Skip to content

Commit 9674fb2

Browse files
authored
Update devices.py
1 parent cf40b41 commit 9674fb2

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

visual_behavior/devices.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,32 @@
5656

5757

5858
# -> devices.py
59-
def get_rig_id(in_val, input_type='computer_name'):
59+
def get_rig_id(computer_name):
6060
'''
6161
This provides a map between the computer name and the rig ID.
6262
6363
>>> get_rig_id('W7DTMJ19R2F')
6464
A1
65-
>>> get_rig_id('A1',input_type='rig_id')
66-
W7DTMJ19R2F
67-
65+
6866
Parameters
6967
----------
7068
in_val : str
7169
computer name
72-
input_type : 'computer_name' or 'rig_id'
73-
specifies whether `in_val` is a computer name or rig_id
7470
'''
75-
if input_type == 'computer_name' and in_val in RIG_NAME.keys():
76-
return RIG_NAME[in_val.lower()]
77-
elif input_type == 'rig_id' and in_val in COMPUTER_NAME.keys():
78-
return COMPUTER_NAME[in_val]
79-
else:
80-
return 'unknown'
71+
72+
return RIG_NAME.get(computer_name.lower(),'unknown')
73+
74+
def get_computer_name(rig_id):
75+
'''
76+
This provides a map between the computer name and the rig ID.
77+
78+
>>> get_computer_name('A1')
79+
W7DTMJ19R2F
80+
81+
Parameters
82+
----------
83+
rig_id : str
84+
rig name
85+
'''
86+
87+
return COMPUTER_NAME.get(rig_id,'unknown')

0 commit comments

Comments
 (0)