summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-01-29 10:53:27 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-01-29 10:53:27 +0100
commitf931a9cce20cb1c719e793b7b7c6494ade9ae21f (patch)
treece39f493dde09c5a905275cb166d76725c0a01ec /lib
parent3ecf5ee900b6a7a202ee2f280d628abae2a4cb91 (diff)
add some tests
Diffstat (limited to 'lib')
-rwxr-xr-xlib/dfatool.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py
index fa91fc2..b9c14bb 100755
--- a/lib/dfatool.py
+++ b/lib/dfatool.py
@@ -253,7 +253,8 @@ class RawData:
for trace in self.traces_by_fileno:
self.traces.extend(trace)
- def get_preprocessed_data(self):
+ def get_preprocessed_data(self, verbose = True):
+ self.verbose = verbose
if self.preprocessed:
return self.traces
if self.version == 0:
@@ -287,14 +288,15 @@ class RawData:
if self._measurement_is_valid(measurement):
self._merge_measurement_into_online_data(measurement)
num_valid += 1
- else:
+ elif self.verbose:
print('[W] Skipping {ar:s}/{m:s}: {e:s}'.format(
ar = self.filenames[measurement['fileno']],
m = measurement['info'].name,
e = measurement['error']))
- print('[I] {num_valid:d}/{num_total:d} measurements are valid'.format(
- num_valid = num_valid,
- num_total = len(measurements)))
+ if self.verbose:
+ print('[I] {num_valid:d}/{num_total:d} measurements are valid'.format(
+ num_valid = num_valid,
+ num_total = len(measurements)))
self._concatenate_analyzed_traces()
self.preprocessing_stats = {
'num_runs' : len(measurements),