import plotly.express as px
import pandas as pd
# df = pd.read_parquet("era5-pds/measurements-m1.parquet")
# df = pd.read_parquet("era5-pds/measurements-i10k.parquet")
# df = pd.read_parquet("era5-pds/measurements-ryzen3.parquet")
# df = pd.read_parquet("era5-pds/measurements-i13k.parquet")
df = pd.read_parquet("era5-pds/measurements-never-split-clang.parquet")
df = df.query("clevel > 0") # get rid of no compression results
category_orders = {"dset": ["flux", "wind", "pressure", "precip", "snow"],
"filter": ["nofilter", "shuffle", "bitshuffle", "bytedelta"]}
labels = {
"cratio": "Compression ratio (x times)",
"cspeed": "Compression speed (GB/s)",
"dspeed": "Decompression speed (GB/s)",
"codec": "Codec",
"dset": "Dataset",
"filter": "Filter",
"cratio * cspeed": "Compression ratio x Compression speed",
"cratio * dspeed": "Compression ratio x Decompression speed",
"cratio * cspeed * dspeed": "Compression ratio x Compression x Decompression speeds",
}
hover_data = {"filter": False, "codec": True, "cratio": ':.1f', "cspeed": ':.2f',
"dspeed": ':.2f', "dset": True, "clevel": True}
fig = px.box(df, x="cratio", color="filter", points="all", hover_data=hover_data,
labels=labels, range_x=(0, 60), range_y=(-.4, .35),)
fig.update_layout(
title={
'text': "Compression ratio vs filter (larger is better)",
#'y':0.9,
'x':0.25,
'xanchor': 'left',
#'yanchor': 'top'
},
#xaxis_title="Filter",
)
fig.show()
hover_data = {"filter": False, "codec": True, "cratio": ':.1f', "cspeed": ':.2f', "dspeed": ':.2f',
"dset": False, "clevel": True}
fig = px.strip(df, y="cratio", x="dset", color="filter", hover_data=hover_data, labels=labels,
category_orders=category_orders)
fig.show()
hover_data = {"filter": False, "codec": False, "cratio": ':.1f', "cspeed": ':.2f', "dspeed": ':.2f',
"dset": True, "clevel": True}
fig = px.strip(df, y="cratio", x="codec", color="filter", labels=labels, hover_data=hover_data)
fig.show()
df["cratio * cspeed"] = df["cratio"] * df["cspeed"]
df["cratio * dspeed"] = df["cratio"] * df["dspeed"]
df["cratio * cspeed * dspeed"] = df["cratio"] * df["cspeed"] * df["dspeed"]
df_mean = df.groupby(['filter', 'clevel', 'codec']).mean(numeric_only=True).reset_index(level=[0,1,2])
df_mean2 = df.groupby(['filter', 'dset']).mean(numeric_only=True).reset_index(level=[0,1])
df_mean
filter | clevel | codec | cspeed | dspeed | cratio | cratio * cspeed | cratio * dspeed | cratio * cspeed * dspeed | |
---|---|---|---|---|---|---|---|---|---|
0 | bitshuffle | 1 | BLOSCLZ | 7.170084 | 55.858812 | 8.390778 | 83.027158 | 565.574227 | 5769.446804 |
1 | bitshuffle | 1 | LZ4 | 8.841304 | 72.733990 | 11.659186 | 115.952235 | 912.763447 | 9173.500450 |
2 | bitshuffle | 1 | LZ4HC | 5.011549 | 69.898448 | 12.829870 | 85.434218 | 961.023019 | 6596.327742 |
3 | bitshuffle | 1 | ZLIB | 6.048663 | 25.746785 | 10.984466 | 79.536823 | 316.243356 | 2349.577280 |
4 | bitshuffle | 1 | ZSTD | 9.694822 | 46.743573 | 16.577713 | 233.164940 | 866.937517 | 12633.817668 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
75 | shuffle | 9 | BLOSCLZ | 8.435880 | 65.908274 | 10.812125 | 116.364216 | 903.817529 | 10247.816016 |
76 | shuffle | 9 | LZ4 | 7.967760 | 85.155980 | 10.846365 | 117.074240 | 1126.169488 | 12717.891633 |
77 | shuffle | 9 | LZ4HC | 1.301430 | 94.358108 | 13.622630 | 29.840602 | 1463.396178 | 3261.472281 |
78 | shuffle | 9 | ZLIB | 0.854015 | 16.061254 | 17.034856 | 24.063091 | 284.392961 | 375.278958 |
79 | shuffle | 9 | ZSTD | 0.196071 | 42.514327 | 19.582059 | 4.648989 | 1130.597586 | 281.939947 |
80 rows × 9 columns
fig = px.bar(df_mean, y="cratio", x="codec", color="filter", category_orders=category_orders,
barmode="group", facet_col="clevel", labels=labels, title="Compression ratio (mean)")
fig.show()
fig = px.bar(df_mean, y="cspeed", x="codec", color="filter", category_orders=category_orders,
barmode="group", facet_col="clevel", labels=labels, title="Compression speed (mean)")
fig.show()
fig = px.bar(df_mean2, y="cspeed", x="filter", facet_col="dset", color="filter", log_y=True,
labels=labels, category_orders=category_orders)
fig.show()
fig = px.strip(df, y="cspeed", x="codec", color="filter", hover_data=hover_data, labels=labels)
fig.show()
fig = px.bar(df_mean, y="dspeed", x="codec", color="filter",
category_orders=category_orders, barmode="group",
facet_col="clevel", labels=labels, title="Decompression speed (mean)")
fig.show()
fig = px.bar(df_mean2, y="dspeed", x="filter", facet_col="dset", color="filter", log_y=True,
labels=labels, category_orders=category_orders)
fig.show()
fig = px.strip(df, y="dspeed", x="codec", color="filter", hover_data=hover_data, labels=labels)
fig.show()
hover_data = {"filter": True, "codec": True, "cratio": ':.1f', "cspeed": ':.2f',
"dspeed": ':.2f', "dset": True, "clevel": True}
fig = px.scatter(df, y="cratio", x="cspeed", color="filter", log_y=True,
hover_data=hover_data, labels=labels)
fig.show()
fig = px.box(df, y="cratio * cspeed", x="codec", color="filter", log_y=True,
hover_data=hover_data, labels=labels)
fig.show()
fig = px.bar(df_mean, y="cratio * cspeed", x="codec", color="filter", log_y=True,
labels=labels, facet_col="clevel", barmode="group", category_orders=category_orders)
fig.show()
fig = px.bar(df_mean2, y="cratio * cspeed", x="filter", facet_col="dset", color="filter", log_y=True,
labels=labels, category_orders=category_orders)
fig.show()
hover_data = {"filter": True, "codec": True, "cratio": ':.1f', "cspeed": ':.2f',
"dspeed": ':.2f', "dset": True, "clevel": True}
fig = px.scatter(df, y="cratio", x="dspeed", color="filter", log_y=True,
hover_data=hover_data, labels=labels)
fig.show()
fig = px.box(df, y="cratio * dspeed", x="codec", color="filter", log_y=True,
hover_data=hover_data, labels=labels, category_orders=category_orders)
fig.show()
fig = px.bar(df_mean, y="cratio * dspeed", x="codec", color="filter", log_y=True,
labels=labels, facet_col="clevel", barmode="group", category_orders=category_orders)
fig.show()
fig = px.bar(df_mean2, y="cratio * dspeed", x="filter", facet_col="dset", color="filter", log_y=True,
labels=labels, category_orders=category_orders)
fig.show()
fig = px.box(df, y="cratio * cspeed * dspeed", x="codec", color="filter",
log_y=True, hover_data=hover_data, labels=labels, category_orders=category_orders)
fig.show()
fig = px.bar(df_mean, y="cratio * cspeed * dspeed", x="codec", color="filter", log_y=True,
labels=labels, facet_col="clevel", barmode="group", category_orders=category_orders)
fig.show()
fig = px.bar(df_mean2, y="cratio * cspeed * dspeed", x="filter", facet_col="dset", color="filter", log_y=True,
labels=labels, category_orders=category_orders)
fig.show()