Skip to content

Commit 325c3e2

Browse files
committed
Adjust arange for backwards compatibility
1 parent e34aef0 commit 325c3e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/blosc2/ndarray.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3642,7 +3642,7 @@ def ones(shape: int | tuple | list, dtype: np.dtype | str = None, **kwargs: Any)
36423642
def arange(
36433643
start: int | float,
36443644
stop: int | float | None = None,
3645-
step: int | float = 1,
3645+
step: int | float | None = 1,
36463646
dtype: np.dtype | str = None,
36473647
shape: int | tuple | list | None = None,
36483648
c_order: bool = True,
@@ -3704,6 +3704,8 @@ def arange_fill(inputs, output, offset):
37043704
# use linspace to have finer control over exclusion of endpoint
37053705
output[:] = np.linspace(start, stop, num=lout, endpoint=False, dtype=output.dtype)
37063706

3707+
if step is None: # not array-api compliant but for backwards compatibility
3708+
step = 1
37073709
if stop is None:
37083710
stop = start
37093711
start = 0

0 commit comments

Comments
 (0)