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 | 3.641980 | 5.250033 | 9.172098 | 41.053547 | 50.184810 | 226.680428 |
1 | bitshuffle | 1 | LZ4 | 4.275299 | 5.506148 | 11.893360 | 57.615556 | 68.947949 | 336.408697 |
2 | bitshuffle | 1 | LZ4HC | 1.750397 | 5.401747 | 12.767749 | 27.354146 | 71.338902 | 154.098057 |
3 | bitshuffle | 1 | ZLIB | 1.925020 | 2.668712 | 11.199384 | 27.058481 | 35.212037 | 88.657049 |
4 | bitshuffle | 1 | ZSTD | 3.438728 | 3.998618 | 15.783370 | 66.284538 | 69.518786 | 296.993320 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
75 | shuffle | 9 | BLOSCLZ | 3.595039 | 14.897499 | 11.336596 | 74.288519 | 254.509884 | 2011.423526 |
76 | shuffle | 9 | LZ4 | 6.746394 | 20.373135 | 10.961870 | 113.363588 | 313.533877 | 3635.387884 |
77 | shuffle | 9 | LZ4HC | 0.629569 | 23.061282 | 12.926353 | 14.108845 | 353.912710 | 424.337064 |
78 | shuffle | 9 | ZLIB | 0.214299 | 2.522937 | 16.330219 | 5.082489 | 47.910145 | 14.972772 |
79 | shuffle | 9 | ZSTD | 0.027834 | 7.210564 | 18.285242 | 0.525068 | 178.636580 | 5.260479 |
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()