Skip to content

Commit 3c973bb

Browse files
committed
Fix divide by zero case
1 parent 7cc4283 commit 3c973bb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cubed/core/rechunk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def _multspace(start, stop, num):
7474
vals = np.geomspace(start, stop, num + 2)
7575
vint = 1
7676
for v in vals:
77-
vint = floor(v / vint) * vint
77+
# next value is int multiple closest to geomspace value (rounded down)
78+
vint = max(floor(v / vint) * vint, 1)
7879
yield vint
7980

8081

0 commit comments

Comments
 (0)