Skip to content

Commit

Permalink
add skip_trailing_dim to _ravel_shape_indices
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-gould committed Jul 12, 2024
1 parent ea976ab commit 6c8a31b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dask_image/ndmeasure/_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _ravel_shape_indices_kernel(*args):
return sum(args2)


def _ravel_shape_indices(dimensions, dtype=int, chunks=None):
def _ravel_shape_indices(dimensions, dtype=int, chunks=None, skip_trailing_dim:bool=False):
"""
Gets the raveled indices shaped like input.
"""
Expand All @@ -61,7 +61,7 @@ def _ravel_shape_indices(dimensions, dtype=int, chunks=None):
dtype=dtype,
chunks=c
)
for i, c in enumerate(chunks)
for i, c in enumerate(chunks[:-1] if skip_trailing_dim else chunks)
]

indices = da.blockwise(
Expand Down

0 comments on commit 6c8a31b

Please sign in to comment.