aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-05-16 15:13:50 +0200
committerKarel Kočí <cynerd@email.cz>2015-05-16 15:13:50 +0200
commit65c98d1fb0d9447254dcf5013c42cc23b74cdf82 (patch)
tree84ff4df630e7237900994efeeb853c3c59644d5a /scripts
parent599690760476bf7c9c2be226c40cc70c813aa60d (diff)
downloadlinux-conf-perf-65c98d1fb0d9447254dcf5013c42cc23b74cdf82.tar.gz
linux-conf-perf-65c98d1fb0d9447254dcf5013c42cc23b74cdf82.tar.bz2
linux-conf-perf-65c98d1fb0d9447254dcf5013c42cc23b74cdf82.zip
Divide evaluete script to functions
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/evaluate.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/evaluate.py b/scripts/evaluate.py
index 436879d..38a6cad 100755
--- a/scripts/evaluate.py
+++ b/scripts/evaluate.py
@@ -41,9 +41,7 @@ def reduce_matrix(A, symrow):
columns.append(column)
i -= 1
-
-def evaluate():
- print("Collect data...")
+def collect_data():
hashs = {}
for fl in os.listdir(sf(conf.result_folder)):
if os.path.isfile(os.path.join(sf(conf.result_folder), fl)):
@@ -67,8 +65,9 @@ def evaluate():
for ln in f:
vec.append(float(ln))
hashs[hash][1] = vec
+ return hashs
- print('Build matrix...')
+def build_matrix(hashs):
A = []
B = []
for hash,data in hashs.items():
@@ -83,6 +82,14 @@ def evaluate():
A[x][y] = 0
else:
A[x][y] = 1
+ return A, B, symrow
+
+def evaluate():
+ print("Collect data...")
+ hashs = collect_data()
+
+ print('Build matrix...')
+ A, B, symrow = build_matrix(hashs)
# Reduce matrix A
print('Simplify matrix...')