From 69f6a0bd10d76d72da799bb22132e8555bc13dd3 Mon Sep 17 00:00:00 2001 From: J08nY Date: Fri, 26 Nov 2021 15:23:06 +0100 Subject: Add performance plotting. --- test/plots/plot_perf.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/plots/plot_perf.py (limited to 'test/plots') diff --git a/test/plots/plot_perf.py b/test/plots/plot_perf.py new file mode 100644 index 0000000..7054543 --- /dev/null +++ b/test/plots/plot_perf.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +import click + +from pathlib import Path +import holoviews as hv +import numpy as np + + +@click.command() +@click.option( + "-d", + "--directory", + type=click.Path(file_okay=False, dir_okay=True), + default=None, + envvar="DIR", + required=True +) +def main(directory): + directory = Path(directory) + for f in directory.glob("*.csv"): + pname = str(f).removesuffix(".csv") + d = np.genfromtxt(f, delimiter=",", dtype=None, encoding="ascii", names=("commit", "pyversion", "time")) + if len(d.shape) == 0: + d.shape = (1,) + line = hv.Curve(zip(d["commit"], d["time"]), "commit", "duration") + hv.save(line, pname + ".svg", fmt="svg") + + +if __name__ == "__main__": + main() -- cgit v1.2.3-70-g09d2