Skip to content

Commit

Permalink
fix(shard): enable floating support for create_sharded_image_info
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Jan 29, 2025
1 parent 6b9d787 commit e5025d1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions igneous/task_creation/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,14 @@ def create_sharded_image_info(
"""
if isinstance(dtype, int):
byte_width = dtype
elif isinstance(dtype, str) or np.issubdtype(dtype, np.integer):
elif (
isinstance(dtype, str)
or np.issubdtype(dtype, np.integer)
or np.issubdtype(dtype, np.floating)
):
byte_width = np.dtype(dtype).itemsize
else:
raise ValueError(f"{dtype} must be int, str, or np.integer.")
raise ValueError(f"{dtype} must be int, str, np.integer, or np.floating.")

voxels = prod(dataset_size)
chunk_voxels = prod(chunk_size)
Expand Down

0 comments on commit e5025d1

Please sign in to comment.