Skip to content

Commit

Permalink
Merge pull request #478 from seung-lab/multi-decompress-fallback
Browse files Browse the repository at this point in the history
fix: fallback for when multi decompress fails
  • Loading branch information
akhileshh authored Nov 22, 2023
2 parents c6947a9 + c60147d commit 40df69d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pychunkedgraph/io/edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ def _parse_edges(compressed: List[bytes]) -> List[Dict]:
n_threads = int(os.environ.get("ZSTD_THREADS", 1))
except ValueError:
n_threads = 1
decompressed = zdc.multi_decompress_to_buffer(compressed, threads=n_threads)

decompressed = []
try:
decompressed = zdc.multi_decompress_to_buffer(compressed, threads=n_threads)
except ValueError:
for content in compressed:
decompressed.append(zdc.decompressobj().decompress(content))

for content in decompressed:
chunk_edges = ChunkEdgesMsg()
chunk_edges.ParseFromString(memoryview(content))
Expand Down

0 comments on commit 40df69d

Please sign in to comment.