-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
35 lines (30 loc) · 933 Bytes
/
main.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
from sys import argv
from decimal import Decimal
from src.Config import Config
from src.Data import Data
from src.Math import EuclideanDistance
def main(args):
file = 'examples/vectors.csv'
if args[1] == 'g':
if len(args) == 4:
nrows = int(args[2])
ncols = int(args[3])
else:
nrows = 501
ncols = 11
config = Config(
file=file,
nrows=nrows,
ncols=ncols,
)
Data(config)
elif args[1] == 'a':
data = Data(file=file)
ed = EuclideanDistance(data)
with open('examples/summary.txt', 'w+') as handle:
handle.write('min:' + str(ed.min) + '\n')
handle.write('max:' + str(ed.max) + '\n')
handle.write('xlabels: ' + str(ed._get_xlabels(Decimal('0.1'))) + '\n')
ed.histogram('examples/hist.png')
if __name__ == '__main__':
main(argv)