|
9 | 9 | ''' |
10 | 10 |
|
11 | 11 | from __future__ import print_function |
| 12 | +import plasma.global_vars as g |
12 | 13 | import os |
13 | 14 | import time |
14 | 15 | import sys |
@@ -74,7 +75,7 @@ def load_stats(self): |
74 | 75 | pass |
75 | 76 |
|
76 | 77 | def print_summary(self, action='loaded'): |
77 | | - print('{} normalization data from {} shots ( {} disruptive )'.format( |
| 78 | + g.print_unique('{} normalization data from {} shots ( {} disruptive )'.format( |
78 | 79 | action, self.num_processed, self.num_disruptive)) |
79 | 80 |
|
80 | 81 | def set_inference_mode(self, val): |
@@ -149,7 +150,7 @@ def train_on_files(self, shot_files, use_shots, all_machines): |
149 | 150 | self.save_stats() |
150 | 151 | else: |
151 | 152 | self.load_stats() |
152 | | - print(self) |
| 153 | + g.print_unique(self) |
153 | 154 |
|
154 | 155 | def cut_end_of_shot(self, shot): |
155 | 156 | cut_shot_ends = self.conf['data']['cut_shot_ends'] |
@@ -222,7 +223,7 @@ def __str__(self): |
222 | 223 | for machine in self.means: |
223 | 224 | means = np.median(self.means[machine], axis=0) |
224 | 225 | stds = np.median(self.stds[machine], axis=0) |
225 | | - s += 'Machine: {}:\nMean Var Normalizer.\n'.format(machine) |
| 226 | + s += 'Machine = {}:\nMean Var Normalizer.\n'.format(machine) |
226 | 227 | s += 'means: {}\nstds: {}'.format(means, stds) |
227 | 228 | return s |
228 | 229 |
|
@@ -304,8 +305,8 @@ def load_stats(self): |
304 | 305 | self.num_disruptive = dat['num_disruptive'][()] |
305 | 306 | self.machines = dat['machines'][()] |
306 | 307 | for machine in self.means: |
307 | | - print('Machine {}:'.format(machine)) |
308 | | - self.print_summary() |
| 308 | + g.print_unique('Machine = {}:'.format(machine)) |
| 309 | + self.print_summary() |
309 | 310 |
|
310 | 311 |
|
311 | 312 | class VarNormalizer(MeanVarNormalizer): |
@@ -452,7 +453,7 @@ def load_stats(self): |
452 | 453 | self.num_disruptive = dat['num_disruptive'][()] |
453 | 454 | self.machines = dat['machines'][()] |
454 | 455 | for machine in self.means: |
455 | | - print('Machine {}:'.format(machine)) |
| 456 | + g.print_unique('Machine {}:'.format(machine)) |
456 | 457 | self.print_summary() |
457 | 458 |
|
458 | 459 |
|
|
0 commit comments