-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_task.sh
52 lines (40 loc) · 1.17 KB
/
run_task.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/python3
from krave.experiment.task import Task
from krave.ui.constants import PATHS
import sys
import os
import csv
def get_experiment_options_data():
'''Read data from communications2 written by UI.py and provided by the tkinter selection of conditions script'''
options = []
if os.path.exists(PATHS.COMMUNICATION2):
with open(PATHS.COMMUNICATION2, "r") as file:
reader = csv.reader(file)
for row in reader:
options.append(row)
os.remove(PATHS.COMMUNICATION2)
else:
print("Data Error")
sys.exit(1)
for i in range(len(options)):
options[i] = options[i][0]
if options[3] == "True":
options[3] = True
else:
options[3] = False
if options[4] == "True":
options[4] = True
else:
options[4] = False
return(options)
if __name__ == '__main__':
options = get_experiment_options_data()
Task(mouse=options[5],
rig_name=options[0],
training=options[1],
trainer=options[2],
record=options[3],
forward_file = options[4]).run()
'''execute:
$ chmod +x run_task.sh
in first instalation'''