-
Notifications
You must be signed in to change notification settings - Fork 0
/
loader_merged.py
52 lines (43 loc) · 1.39 KB
/
loader_merged.py
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
"""
Updated: 2017
Author: Sergei Shliakhtin
Contact: [email protected]
Notes:
Takes an input csv in the following format:
TOOL, WAFER_COUNT, RECIPE, CYCLE_TIME, SEQUENCE_NO
and sends it to main.py according to usual protocol (see README)
"""
import argparse
import csv
import sys
from cycle_ml.aux import my_call
parser = argparse.ArgumentParser()
parser.add_argument("fname", default="", type=str)
parser.add_argument("--verbose", action="store_true")
args = parser.parse_args()
fname = args.fname
print("Reading {}".format(fname))
with open(fname, newline="") as csv_file:
reader = csv.reader(csv_file)
"""Skip header"""
for row in reader:
break
for row in reader:
try:
assert len(row) == 5, "Should have 5 columns"
tool = row[0]
wc = float(row[1])
recipe = row[2]
ct = float(row[3])
sequence = int(row[4])
tool_recipe = tool + "," + recipe
print("\n")
cmd = ["python", "main.py", "--next_datapoint", str(wc), tool_recipe]
if args.verbose:
cmd.append("--verbose")
if 0 != my_call(cmd):
sys.exit(1)
print("\n")
my_call(["python", "main.py", "--finish_datapoint", str(ct), tool_recipe, "--sequence", str(sequence)])
except KeyboardInterrupt:
sys.exit(0)