Skip to content

Commit

Permalink
Merge pull request #6 from chris-delg/main
Browse files Browse the repository at this point in the history
adding refactoring changes to cpp-zarr branch
  • Loading branch information
chris-delg authored Aug 16, 2024
2 parents 10741c9 + c025001 commit 935b83f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 131 deletions.
41 changes: 18 additions & 23 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
def main() -> None:

def run_all_tests(shape: list, chunks: list) -> None:
bandwidth_map = {}
fig, graph = plt.subplots(2, 2)

zarr_python = Zarr_Python(shape=shape, chunks=chunks)
tensorstore = Tensorstore(shape=shape, chunks=chunks)
ome_zarr = Ome_Zarr(shape=shape, chunks=chunks)
bandwidth_map = {}
zarr_writers = {
"TensorStore" : Tensorstore(shape=shape, chunks=chunks),
"Zarr Python" : Zarr_Python(shape=shape, chunks=chunks),
"OME Zarr" : Ome_Zarr(shape=shape, chunks=chunks)
}

'''
Append Tests:
Expand All @@ -19,12 +20,13 @@ def run_all_tests(shape: list, chunks: list) -> None:
* TensorStore
* Zarr Python
'''
bandwidth_map["TensorStore Append"] = (
tensorstore.continuous_append_test(graph=graph[1][0], avg_graph=graph[1][1], append_dim_size=100)
)
#bandwidth_map["Zarr Python Append"] = (
# zarr_python.continuous_append_test(graph=graph[1][0], avg_graph=graph[1][1], append_dim_size=100)
#)
for name, writer in zarr_writers.items():
if name != "TensorStore" and name != "Zarr Python":
continue

bandwidth_map[name + " Append"] = (
writer.continuous_append_test(graph=graph[1][0], avg_graph=graph[1][1], append_dim_size=50)
)

# setting up graph for append tests
graph[1][0].set_xlabel("Write Number")
Expand All @@ -38,18 +40,12 @@ def run_all_tests(shape: list, chunks: list) -> None:
* TensorStore
* Zarr Python
* OME Zarr
bandwidth_map["TensorStore Write"] = (
tensorstore.continuous_write_test(graph=graph[0][0], avg_graph=graph[0][1], append_dim_size=51, step=5)
)
bandwidth_map["Zarr Python Write"] = (
zarr_python.continuous_write_test(graph=graph[0][0], avg_graph=graph[0][1], append_dim_size=51, step=5)
)
# ome-zarr usually crashes before the other libraries
bandwidth_map["OME Zarr Write"] = (
ome_zarr.continuous_write_test(graph=graph[0][0], avg_graph=graph[0][1], append_dim_size=46, step=5)
)
'''
for name, writer in zarr_writers.items():
bandwidth_map[name + " Write"] = (
writer.continuous_write_test(graph=graph[0][0], avg_graph=graph[0][1], append_dim_size=15, step=5)
)

# print the average bandwidth for each of the tests
print(f"Shape {shape}, Chunks {chunks}")
print("----------Bandwidth----------")
Expand All @@ -75,7 +71,6 @@ def run_all_tests(shape: list, chunks: list) -> None:


run_all_tests(shape=[64, 1080, 1920], chunks=[64, 540, 960])
#run_all_tests(shape=[64, 1920, 1920], chunks=[64, 540, 960])
plt.show()


Expand Down
108 changes: 0 additions & 108 deletions zarr_libraries/acquire/acquire_zarr.py

This file was deleted.

0 comments on commit 935b83f

Please sign in to comment.