...
 
Commits (2)
......@@ -55,7 +55,7 @@ class Metrics:
import collections
grouped = collections.defaultdict(lambda: []) # type: DefaultDict[Label, List[float]]
for k,v in self.metrics:
grouped[k].append(v)
grouped[tuple(k)].append(v)
return grouped
......@@ -186,6 +186,7 @@ def main() -> None:
stdin=Path(args.stdin.name) if args.stdin else None)
new_metrics = old_metrics + metrics
output_path.parent.mkdir(parents=True, exist_ok=True)
if output_path.suffix == '.json':
new_metrics.write_json(output_path.open('w'))
else:
......@@ -199,7 +200,8 @@ def main() -> None:
for k,vs in sorted(metrics.grouped().items()):
mu = mean(vs)
stderr = std(vs) / sqrt(len(vs)) / mu * 100 if mu != 0 else 0
print(f'{k:60s} {mu:<8.2g} +/- {stderr:>4.1f}%')
k2 = pack_label(k)
print(f'{k2:60s} {mu:<8.2g} +/- {stderr:>4.1f}%')
print("")
print(f'Metrics from {args.repeat} repetitions saved in {output_path}')
......