Skip to content

Commit 545e160

Browse files
dberenbaumefiop
andauthored
plots: hacky plots (#355)
* plots: hacky plots * gha: lint: show diff on failure Co-authored-by: Ruslan Kuprieiev <[email protected]>
1 parent c38a90b commit 545e160

36 files changed

+333
-82
lines changed

.dvc/plot/confusion.json

-30
This file was deleted.

.dvc/plot/default.json

-26
This file was deleted.

.dvc/plot/scatter.json

-24
This file was deleted.

.dvc/plots/linear_versions.json

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
3+
"data": {
4+
"values": "<DVC_METRIC_DATA>"
5+
},
6+
"title": "<DVC_METRIC_TITLE>",
7+
"width": 300,
8+
"height": 300,
9+
"layer": [
10+
{
11+
"encoding": {
12+
"x": {
13+
"field": "<DVC_METRIC_X>",
14+
"title": "<DVC_METRIC_X_LABEL>",
15+
"sort": "index"
16+
},
17+
"y": {
18+
"field": "<DVC_METRIC_Y>",
19+
"type": "quantitative",
20+
"title": "<DVC_METRIC_Y_LABEL>"
21+
},
22+
"color": {
23+
"field": "rev",
24+
"type": "nominal"
25+
},
26+
"order": {
27+
"field": "index",
28+
"type": "ordinal"
29+
}
30+
},
31+
"layer": [
32+
{
33+
"mark": "line"
34+
},
35+
{
36+
"selection": {
37+
"label": {
38+
"type": "single",
39+
"nearest": true,
40+
"on": "mouseover",
41+
"encodings": [
42+
"x"
43+
],
44+
"empty": "none",
45+
"clear": "mouseout"
46+
}
47+
},
48+
"mark": "point",
49+
"encoding": {
50+
"opacity": {
51+
"condition": {
52+
"selection": "label",
53+
"value": 1
54+
},
55+
"value": 0
56+
}
57+
}
58+
}
59+
]
60+
},
61+
{
62+
"transform": [
63+
{
64+
"filter": {
65+
"selection": "label"
66+
}
67+
}
68+
],
69+
"layer": [
70+
{
71+
"mark": {
72+
"type": "rule",
73+
"color": "gray"
74+
},
75+
"encoding": {
76+
"x": {
77+
"field": "<DVC_METRIC_X>",
78+
"sort": "index"
79+
}
80+
}
81+
},
82+
{
83+
"encoding": {
84+
"text": {
85+
"type": "quantitative",
86+
"field": "<DVC_METRIC_Y>"
87+
},
88+
"x": {
89+
"field": "<DVC_METRIC_X>",
90+
"sort": "index"
91+
},
92+
"y": {
93+
"field": "<DVC_METRIC_Y>",
94+
"type": "quantitative"
95+
}
96+
},
97+
"layer": [
98+
{
99+
"mark": {
100+
"type": "text",
101+
"align": "left",
102+
"dx": 5,
103+
"dy": -5
104+
},
105+
"encoding": {
106+
"color": {
107+
"type": "nominal",
108+
"field": "rev"
109+
}
110+
}
111+
}
112+
]
113+
}
114+
]
115+
}
116+
]
117+
}

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
pip install wheel
3838
pip install -r requirements.txt
3939
- name: check project styling
40-
run: pre-commit run --all-files
40+
run: pre-commit run --all-files --show-diff-on-failure
4141
gen:
4242
runs-on: ubuntu-latest
4343
outputs:

dvc.lock

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
schema: '2.0'
2+
stages:
3+
gen_plots:
4+
cmd: python plots.py
5+
deps:
6+
- path: plots.py
7+
md5: d14581b088a19976c87b41f39a1200d6
8+
size: 558
9+
- path: results.csv
10+
md5: 538b4993f552f45b3ac20732ccb95217
11+
size: 26070
12+
outs:
13+
- path: plots
14+
md5: 698fe1027e6ba06b6f37073d15204285.dir
15+
size: 32329
16+
nfiles: 27

dvc.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
stages:
2+
gen_plots:
3+
cmd: python plots.py
4+
deps:
5+
- plots.py
6+
- results.csv
7+
plots:
8+
- plots:
9+
cache: false
10+
x: 'param:dvc_rev'
11+
x_label: 'DVC Revision'
12+
y: mean
13+
y_label: 'Mean Time'
14+
template: linear_versions

plots.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
3+
import pandas as pd
4+
from distutils.version import StrictVersion
5+
6+
df = pd.read_csv("results.csv")
7+
df["test"] = df["name"].str.extract(r"::(.*)\[")
8+
9+
10+
def version(x):
11+
try:
12+
return StrictVersion(x)
13+
except ValueError:
14+
return StrictVersion("99.99.99")
15+
16+
17+
os.makedirs("plots", exist_ok=True)
18+
for test, test_df in df.groupby("test"):
19+
test_df["ver_sort"] = test_df["param:dvc_rev"].apply(version)
20+
test_df = test_df.sort_values("ver_sort").reset_index(drop=True)
21+
test_df.index.name = "index"
22+
test_df.to_csv(f"plots/{test}.csv")

plots/test_add-add.csv

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_add.py::test_add-add[2.6.3],2.6.3,332.2735612050001,332.2735612050001,332.2735612050001,0.0,332.2735612050001,0.0,0;0,0.0030095683700306,1,1,test_add-add,2.6.3
3+
1,tests/benchmarks/cli/commands/test_add.py::test_add-add[2.8.3],2.8.3,357.0697099250001,357.0697099250001,357.0697099250001,0.0,357.0697099250001,0.0,0;0,0.0028005735916665,1,1,test_add-add,2.8.3
4+
2,tests/benchmarks/cli/commands/test_add.py::test_add-add[2.9.5],2.9.5,358.93439585700025,358.93439585700025,358.93439585700025,0.0,358.93439585700025,0.0,0;0,0.0027860244421891,1,1,test_add-add,2.9.5
5+
3,tests/benchmarks/cli/commands/test_add.py::test_add-add[2.10.0],2.10.0,352.3659208939998,352.3659208939998,352.3659208939998,0.0,352.3659208939998,0.0,0;0,0.0028379588964303,1,1,test_add-add,2.10
6+
4,tests/benchmarks/cli/commands/test_add.py::test_add-add[main],main,293.172158291,293.172158291,293.172158291,0.0,293.172158291,0.0,0;0,0.0034109650992418,1,1,test_add-add,99.99.99

plots/test_checkout-checkout-noop.csv

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-noop[2.6.3],2.6.3,2.500541410000096,2.500541410000096,2.500541410000096,0.0,2.500541410000096,0.0,0;0,0.3999133931559092,1,1,test_checkout-checkout-noop,2.6.3
3+
1,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-noop[2.8.3],2.8.3,6.217971195000246,6.217971195000246,6.217971195000246,0.0,6.217971195000246,0.0,0;0,0.1608241609102469,1,1,test_checkout-checkout-noop,2.8.3
4+
2,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-noop[2.9.5],2.9.5,5.44425583400016,5.44425583400016,5.44425583400016,0.0,5.44425583400016,0.0,0;0,0.1836798325594577,1,1,test_checkout-checkout-noop,2.9.5
5+
3,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-noop[2.10.0],2.10.0,5.306598285999826,5.306598285999826,5.306598285999826,0.0,5.306598285999826,0.0,0;0,0.1884446393159734,1,1,test_checkout-checkout-noop,2.10
6+
4,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-noop[main],main,5.234277915000121,5.234277915000121,5.234277915000121,0.0,5.234277915000121,0.0,0;0,0.1910483196037895,1,1,test_checkout-checkout-noop,99.99.99
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-update[2.6.3],2.6.3,94.88412419399992,94.88412419399992,94.88412419399992,0.0,94.88412419399992,0.0,0;0,0.0105391708939147,1,1,test_checkout-checkout-update,2.6.3
3+
1,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-update[2.8.3],2.8.3,38.00906510200002,38.00906510200002,38.00906510200002,0.0,38.00906510200002,0.0,0;0,0.0263095131994546,1,1,test_checkout-checkout-update,2.8.3
4+
2,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-update[2.9.5],2.9.5,34.66704759100003,34.66704759100003,34.66704759100003,0.0,34.66704759100003,0.0,0;0,0.0288458368822735,1,1,test_checkout-checkout-update,2.9.5
5+
3,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-update[2.10.0],2.10.0,34.74823923799977,34.74823923799977,34.74823923799977,0.0,34.74823923799977,0.0,0;0,0.0287784366036718,1,1,test_checkout-checkout-update,2.10
6+
4,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout-update[main],main,40.349377904,40.349377904,40.349377904,0.0,40.349377904,0.0,0;0,0.0247835295597176,1,1,test_checkout-checkout-update,99.99.99

plots/test_checkout-checkout.csv

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout[2.6.3],2.6.3,63.1818875099998,63.1818875099998,63.1818875099998,0.0,63.1818875099998,0.0,0;0,0.0158273207624848,1,1,test_checkout-checkout,2.6.3
3+
1,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout[2.8.3],2.8.3,83.62453495900036,83.62453495900036,83.62453495900036,0.0,83.62453495900036,0.0,0;0,0.0119582129872564,1,1,test_checkout-checkout,2.8.3
4+
2,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout[2.9.5],2.9.5,102.08011368900044,102.08011368900044,102.08011368900044,0.0,102.08011368900044,0.0,0;0,0.0097962273342153,1,1,test_checkout-checkout,2.9.5
5+
3,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout[2.10.0],2.10.0,103.2896065829998,103.2896065829998,103.2896065829998,0.0,103.2896065829998,0.0,0;0,0.0096815162055674,1,1,test_checkout-checkout,2.10
6+
4,tests/benchmarks/cli/commands/test_checkout.py::test_checkout-checkout[main],main,88.98860477499989,88.98860477499989,88.98860477499989,0.0,88.98860477499989,0.0,0;0,0.0112373938497902,1,1,test_checkout-checkout,99.99.99

plots/test_diff-diff-changed-noop.csv

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed-noop[2.6.3],2.6.3,90.92673303200036,90.92673303200036,90.92673303200036,0.0,90.92673303200036,0.0,0;0,0.010997865717314,1,1,test_diff-diff-changed-noop,2.6.3
3+
1,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed-noop[2.8.3],2.8.3,41.53946576699991,41.53946576699991,41.53946576699991,0.0,41.53946576699991,0.0,0;0,0.0240734920764057,1,1,test_diff-diff-changed-noop,2.8.3
4+
2,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed-noop[2.9.5],2.9.5,34.86566686700007,34.86566686700007,34.86566686700007,0.0,34.86566686700007,0.0,0;0,0.0286815107771963,1,1,test_diff-diff-changed-noop,2.9.5
5+
3,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed-noop[2.10.0],2.10.0,35.437922630999765,35.437922630999765,35.437922630999765,0.0,35.437922630999765,0.0,0;0,0.0282183583505325,1,1,test_diff-diff-changed-noop,2.10
6+
4,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed-noop[main],main,3.174017637999896,3.174017637999896,3.174017637999896,0.0,3.174017637999896,0.0,0;0,0.3150581105876113,1,1,test_diff-diff-changed-noop,99.99.99

plots/test_diff-diff-changed.csv

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed[2.6.3],2.6.3,89.31212003100018,89.31212003100018,89.31212003100018,0.0,89.31212003100018,0.0,0;0,0.0111966886426265,1,1,test_diff-diff-changed,2.6.3
3+
1,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed[2.8.3],2.8.3,42.19566154599988,42.19566154599988,42.19566154599988,0.0,42.19566154599988,0.0,0;0,0.0236991188989854,1,1,test_diff-diff-changed,2.8.3
4+
2,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed[2.9.5],2.9.5,35.37422902499975,35.37422902499975,35.37422902499975,0.0,35.37422902499975,0.0,0;0,0.0282691673447717,1,1,test_diff-diff-changed,2.9.5
5+
3,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed[2.10.0],2.10.0,34.44541783700015,34.44541783700015,34.44541783700015,0.0,34.44541783700015,0.0,0;0,0.0290314376423627,1,1,test_diff-diff-changed,2.10
6+
4,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-changed[main],main,33.68136617900018,33.68136617900018,33.68136617900018,0.0,33.68136617900018,0.0,0;0,0.0296900070705411,1,1,test_diff-diff-changed,99.99.99

plots/test_diff-diff-noop.csv

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-noop[2.6.3],2.6.3,57.93432388000019,57.93432388000019,57.93432388000019,0.0,57.93432388000019,0.0,0;0,0.0172609246648205,1,1,test_diff-diff-noop,2.6.3
3+
1,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-noop[2.8.3],2.8.3,8.561673233999954,8.561673233999954,8.561673233999954,0.0,8.561673233999954,0.0,0;0,0.1167995989415735,1,1,test_diff-diff-noop,2.8.3
4+
2,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-noop[2.9.5],2.9.5,3.8153779999997823,3.8153779999997823,3.8153779999997823,0.0,3.8153779999997823,0.0,0;0,0.2620972286363388,1,1,test_diff-diff-noop,2.9.5
5+
3,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-noop[2.10.0],2.10.0,3.503529090000029,3.503529090000029,3.503529090000029,0.0,3.503529090000029,0.0,0;0,0.2854264869254994,1,1,test_diff-diff-noop,2.10
6+
4,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff-noop[main],main,3.509945867000169,3.509945867000169,3.509945867000169,0.0,3.509945867000169,0.0,0;0,0.2849046788447099,1,1,test_diff-diff-noop,99.99.99

plots/test_diff-diff.csv

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff[2.6.3],2.6.3,116.16352329499978,116.16352329499978,116.16352329499978,0.0,116.16352329499978,0.0,0;0,0.0086085543175242,1,1,test_diff-diff,2.6.3
3+
1,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff[2.8.3],2.8.3,71.45220055499976,71.45220055499976,71.45220055499976,0.0,71.45220055499976,0.0,0;0,0.0139953702227863,1,1,test_diff-diff,2.8.3
4+
2,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff[2.9.5],2.9.5,62.29177433399991,62.29177433399991,62.29177433399991,0.0,62.29177433399991,0.0,0;0,0.0160534839582211,1,1,test_diff-diff,2.9.5
5+
3,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff[2.10.0],2.10.0,60.79699943600008,60.79699943600008,60.79699943600008,0.0,60.79699943600008,0.0,0;0,0.016448180161468,1,1,test_diff-diff,2.10
6+
4,tests/benchmarks/cli/commands/test_diff.py::test_diff-diff[main],main,55.25879571899986,55.25879571899986,55.25879571899986,0.0,55.25879571899986,0.0,0;0,0.0180966665485285,1,1,test_diff-diff,99.99.99

plots/test_gc-gc.csv

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_gc.py::test_gc-gc[2.6.3],2.6.3,4.08804847600004,4.08804847600004,4.08804847600004,0.0,4.08804847600004,0.0,0;0,0.2446154946231098,1,1,test_gc-gc,2.6.3
3+
1,tests/benchmarks/cli/commands/test_gc.py::test_gc-gc[2.8.3],2.8.3,4.260282059000019,4.260282059000019,4.260282059000019,0.0,4.260282059000019,0.0,0;0,0.2347262425705967,1,1,test_gc-gc,2.8.3
4+
2,tests/benchmarks/cli/commands/test_gc.py::test_gc-gc[2.9.5],2.9.5,3.660101109999914,3.660101109999914,3.660101109999914,0.0,3.660101109999914,0.0,0;0,0.2732164959235302,1,1,test_gc-gc,2.9.5
5+
3,tests/benchmarks/cli/commands/test_gc.py::test_gc-gc[2.10.0],2.10.0,3.5930902279999373,3.5930902279999373,3.5930902279999373,0.0,3.5930902279999373,0.0,0;0,0.2783119645054506,1,1,test_gc-gc,2.10
6+
4,tests/benchmarks/cli/commands/test_gc.py::test_gc-gc[main],main,3.237301605000084,3.237301605000084,3.237301605000084,0.0,3.237301605000084,0.0,0;0,0.308899238321038,1,1,test_gc-gc,99.99.99

plots/test_get-get.csv

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
index,name,param:dvc_rev,min,max,mean,stddev,median,iqr,outliers,ops,rounds,iterations,test,ver_sort
2+
0,tests/benchmarks/cli/commands/test_get.py::test_get-get[2.6.3],2.6.3,120.5367786429997,120.5367786429997,120.5367786429997,0.0,120.5367786429997,0.0,0;0,0.0082962230387934,1,1,test_get-get,2.6.3
3+
1,tests/benchmarks/cli/commands/test_get.py::test_get-get[2.8.3],2.8.3,99.47031682399984,99.47031682399984,99.47031682399984,0.0,99.47031682399984,0.0,0;0,0.0100532503758822,1,1,test_get-get,2.8.3
4+
2,tests/benchmarks/cli/commands/test_get.py::test_get-get[2.9.5],2.9.5,103.95698615099992,103.95698615099992,103.95698615099992,0.0,103.95698615099992,0.0,0;0,0.0096193631330123,1,1,test_get-get,2.9.5
5+
3,tests/benchmarks/cli/commands/test_get.py::test_get-get[2.10.0],2.10.0,103.30797336599994,103.30797336599994,103.30797336599994,0.0,103.30797336599994,0.0,0;0,0.0096797949608129,1,1,test_get-get,2.10
6+
4,tests/benchmarks/cli/commands/test_get.py::test_get-get[main],main,169.58718436499998,169.58718436499998,169.58718436499998,0.0,169.58718436499998,0.0,0;0,0.0058966719905421,1,1,test_get-get,99.99.99

0 commit comments

Comments
 (0)