-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into submission-run
- Loading branch information
Showing
10 changed files
with
806 additions
and
1,380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[settings] | ||
known_third_party = fsspec,h5py,pandas,pytest,s3fs,seaborn,tifffile,zarr | ||
known_third_party = fsspec,h5py,matplotlib,numpy,pandas,ptitprince,pytest,requests,s3fs,seaborn,tifffile,zarr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,45 @@ | ||
import json | ||
import os | ||
import re | ||
#!/usr/bin/env python | ||
import argparse | ||
|
||
import matplotlib.pyplot as plt | ||
import pandas as pd | ||
import seaborn as sns | ||
|
||
data_path = os.environ.get("BENCHMARK_DATA", "benchmark_data") | ||
plot_path = os.environ.get("BENCHMARK_PLOT", "benchmark_plot.png") | ||
xy = os.environ.get("XY", "unknown") | ||
|
||
csv = pd.read_csv(f"{data_path}/0_benchmark_data.csv") | ||
|
||
types = ("Overhead", "Zarr", "TIFF", "HDF5") | ||
sources = ("local", "http", "s3") | ||
orders = {"type": types, "source": sources} | ||
|
||
pal_points = "colorblind" | ||
pal_violins = "pastel" | ||
|
||
g = sns.FacetGrid( | ||
csv, | ||
col="source", | ||
col_order=sources, | ||
sharey=False, | ||
height=5, | ||
aspect=0.6, | ||
) | ||
|
||
g = g.map( | ||
sns.boxenplot, | ||
"type", | ||
"seconds", | ||
order=types, | ||
width=0.6, | ||
k_depth=2, | ||
palette=pal_violins, | ||
dodge=True, | ||
showfliers=False, | ||
) | ||
|
||
g = g.map( | ||
sns.stripplot, | ||
"type", # was type | ||
"seconds", | ||
dodge=True, | ||
order=types, | ||
jitter=0.2, | ||
size=3, | ||
palette=pal_points, | ||
) | ||
|
||
g.despine(left=True) | ||
g.set(yscale ='log', ylim=(0.0009, 1)) | ||
|
||
# Set axis labels & ticks # | ||
for ax in g.fig.get_axes(): | ||
label = ax.get_title().replace("source =", "") | ||
ax.set_xlabel(label) | ||
ax.set_xticklabels(types) | ||
ax.set_title("") | ||
for col in ax.collections: | ||
# Remove outline of violins | ||
col.set_edgecolor("white") | ||
|
||
# Only show on far left plot | ||
g.fig.get_axes()[0].set_ylabel("Seconds") | ||
g.fig.get_axes()[0].spines["left"].set_visible(True) | ||
|
||
# Add annotations | ||
g.fig.get_axes()[0].text(0.0001, 0.001, "off-\nscale") | ||
|
||
g.savefig(plot_path, dpi=600) | ||
import ptitprince as pt | ||
|
||
|
||
def plot_csv(filename: str, pngpath: str): | ||
csv = pd.read_csv(filename) | ||
|
||
f, ax = plt.subplots(figsize=(8, 6)) | ||
ax = pt.RainCloud( | ||
x="type", | ||
y="seconds", | ||
hue="source", | ||
data=csv, | ||
palette="Set2", | ||
# bw = .2, | ||
width_viol=0.6, | ||
ax=ax, | ||
orient="h", | ||
alpha=0.65, | ||
# dodge = True, | ||
jitter=0.03, | ||
move=0.2, | ||
# pointplot = True, | ||
) | ||
|
||
# ax.set(ylim=(0.0002, 5)) | ||
ax.set_xscale("log") | ||
ax.set_xlabel("seconds per chunk") | ||
ax.axes.get_yaxis().get_label().set_visible(False) | ||
handles, labels = ax.get_legend_handles_labels() | ||
plt.legend(handles[0:3], labels[0:3], loc="lower left") | ||
plt.tight_layout() | ||
f.savefig(pngpath, dpi=600) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("csv", help="input csv file") | ||
parser.add_argument("png", help="output png file") | ||
ns = parser.parse_args() | ||
plot_csv(ns.csv, ns.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- h5py | ||
- matplotlib | ||
- numpy | ||
- pandas | ||
- pytest | ||
- request | ||
- s3fs | ||
- seaborn | ||
- tifffile | ||
- zarr |
Oops, something went wrong.