-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoSchemerTester.py
41 lines (36 loc) · 1.1 KB
/
AutoSchemerTester.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
import csv, itertools, sys, os
import AutoSchemer
import AutoSchemerSimple
import AutoSchemerCORDS
from SchemaObjects import Table, Schema
from DBHandler import DBHandler
from DBConnection import DBConnection
if __name__ == '__main__':
data_file = 'data/test.csv'
mode = 'cords'
prune = False;
prune_threshold = .20
if len(sys.argv) == 1:
print "No data file argument found... using default file 'data/test.csv'"
else:
data_file = sys.argv[1]
if len(sys.argv) == 3:
mode = sys.argv[2]
data_files = [data_file]
if mode == 'simple':
Auto = AutoSchemerSimple.AutoSchemerSimple(data_files, prune_threshold)
Auto.run(False)
elif mode == 'simpleprune':
Auto = AutoSchemerSimple.AutoSchemerSimple(data_files, prune_threshold)
Auto.run(True)
elif mode == 'cords':
Auto = AutoSchemerCORDS.AutoSchemerCORDS(data_files)
Auto.run(False)
elif mode =='cordsprune':
Auto = AutoSchemerCORDS.AutoSchemerCORDS(data_files)
Auto.run(False)
else:
# do simple
Auto = AutoSchemerSimple.AutoSchemerSimple(data_files)
Auto.run(False)
#Auto.load_db()