Skip to content

Commit 64bd511

Browse files
committed
test: Allow to skip STM32 model info
1 parent c68be78 commit 64bd511

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

microesc/test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ def parse(args):
173173
a('--check', action='store_true', default='',
174174
help='Run a check pass, not actually evaluating')
175175

176+
a('--skip-stats', action='store_true', default='',
177+
help='Do not compute on-device stats')
178+
176179
a('--out', dest='results_dir', default='./data/results',
177180
help='%(default)s')
178181

@@ -223,9 +226,10 @@ def get_stats(row):
223226
layer_info.to_csv(layer_info_path)
224227
return pandas.Series(model_stats)
225228

226-
model_stats = best.groupby(level='experiment').apply(get_stats)
227-
print('Model stats\n', model_stats)
228-
model_stats.to_csv(os.path.join(out_dir, 'stm32stats.csv'))
229+
if not args.skip_stats:
230+
model_stats = best.groupby(level='experiment').apply(get_stats)
231+
print('Model stats\n', model_stats)
232+
model_stats.to_csv(os.path.join(out_dir, 'stm32stats.csv'))
229233

230234
print('Testing models...')
231235
results = evaluate(best, folds, predictor=predict, out_dir=out_dir, dry_run=args.check)

0 commit comments

Comments
 (0)