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 = 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 | 8.521135 | 37.163098 | 12.394004 | 148.448453 | 501.408152 | 6253.902051 |
1 | bitshuffle | 1 | LZ4 | 9.909460 | 44.217161 | 12.307460 | 166.358353 | 576.647578 | 7988.992414 |
2 | bitshuffle | 1 | LZ4HC | 4.159958 | 43.733051 | 13.208067 | 70.761302 | 605.809677 | 3295.282965 |
3 | bitshuffle | 1 | ZLIB | 5.168855 | 13.940715 | 11.603630 | 77.505811 | 186.900015 | 1311.426899 |
4 | bitshuffle | 1 | ZSTD | 8.797193 | 26.460997 | 16.284555 | 204.352339 | 486.648768 | 6403.270085 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
75 | shuffle | 9 | BLOSCLZ | 7.090165 | 44.120614 | 11.680731 | 148.535757 | 703.817960 | 10643.652492 |
76 | shuffle | 9 | LZ4 | 10.490418 | 58.993959 | 11.310522 | 198.642207 | 867.525260 | 17219.304417 |
77 | shuffle | 9 | LZ4HC | 1.491062 | 67.126168 | 13.315973 | 32.524722 | 1046.584163 | 2841.998079 |
78 | shuffle | 9 | ZLIB | 0.601809 | 6.119631 | 16.804231 | 14.217234 | 107.050088 | 87.078144 |
79 | shuffle | 9 | ZSTD | 0.064413 | 26.539378 | 18.811941 | 1.190553 | 733.932425 | 47.901377 |
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()