Skip to content

Commit

Permalink
BugFix: Got rid of rechunking in distributed loading
Browse files Browse the repository at this point in the history
  • Loading branch information
CSSFrancis committed Apr 6, 2023
1 parent a1c8506 commit f16dacf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rsciio/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,14 @@ def get_chunk_index(
"""
nav_shape = np.delete(np.array(shape), signal_axes)
num_frames = np.prod(nav_shape)
indexes = da.arange(num_frames)
indexes = da.reshape(indexes, nav_shape)
indexes = np.arange(num_frames)
indexes = np.reshape(indexes, nav_shape)
chunks = da.core.normalize_chunks(
chunks=chunks, shape=shape, limit=block_size_limit, dtype=dtype
)

nav_chunks = tuple(np.delete(np.array(chunks, dtype=object), signal_axes))
indexes = da.rechunk(indexes, chunks=nav_chunks)
indexes = da.from_array(indexes, chunks=nav_chunks)
return indexes


Expand Down

0 comments on commit f16dacf

Please sign in to comment.