diff options
| author | J08nY | 2021-11-26 15:23:06 +0100 |
|---|---|---|
| committer | J08nY | 2021-11-26 15:23:52 +0100 |
| commit | 69f6a0bd10d76d72da799bb22132e8555bc13dd3 (patch) | |
| tree | 3f76fdc84af73af571697519e9b2de260f417a27 /test/plots | |
| parent | 5d23cffb864a1d0aa3502e45a58dfcd606035b5a (diff) | |
| download | pyecsca-69f6a0bd10d76d72da799bb22132e8555bc13dd3.tar.gz pyecsca-69f6a0bd10d76d72da799bb22132e8555bc13dd3.tar.zst pyecsca-69f6a0bd10d76d72da799bb22132e8555bc13dd3.zip | |
Diffstat (limited to 'test/plots')
| -rw-r--r-- | test/plots/plot_perf.py | 30 |
1 files changed, 30 insertions, 0 deletions
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() |
