Skip to content

Commit fc664ad

Browse files
committed
Cosmetic fixes
1 parent 04532cf commit fc664ad

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/blosc2/ndarray.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5407,7 +5407,7 @@ def arange_fill(inputs, output, offset):
54075407
output[:] = np.linspace(start, stop, lout, endpoint=False, dtype=output.dtype)
54085408

54095409
@blosc2.dsl_kernel
5410-
def kernel_ramp(start, step):
5410+
def ramp_arange(start, step):
54115411
return start + _flat_idx * step # noqa: F821 # DSL index/shape symbols resolved by miniexpr
54125412

54135413
if step is None: # not array-api compliant but for backwards compatibility
@@ -5435,7 +5435,7 @@ def kernel_ramp(start, step):
54355435
return blosc2.zeros(shape, dtype=dtype, **kwargs)
54365436

54375437
# Windows and wasm32 does not support complex numbers in DSL
5438-
if False or blosc2.isdtype(dtype, "complex floating"):
5438+
if blosc2.isdtype(dtype, "complex floating"):
54395439
lshape = (math.prod(shape),)
54405440
lazyarr = blosc2.lazyudf(arange_fill, (start, stop, step), dtype=dtype, shape=lshape)
54415441

@@ -5445,7 +5445,7 @@ def kernel_ramp(start, step):
54455445

54465446
return reshape(lazyarr, shape, c_order=c_order, **kwargs)
54475447
else:
5448-
lazyarr = blosc2.lazyudf(kernel_ramp, (start, step), dtype=dtype, shape=shape)
5448+
lazyarr = blosc2.lazyudf(ramp_arange, (start, step), dtype=dtype, shape=shape)
54495449
return lazyarr.compute(**kwargs)
54505450

54515451

@@ -5512,7 +5512,7 @@ def linspace_fill(inputs, output, offset):
55125512
output[:] = np.linspace(start_, stop_, lout, endpoint=False, dtype=output.dtype)
55135513

55145514
@blosc2.dsl_kernel
5515-
def kernel_ramp(start, step):
5515+
def ramp_linspace(start, step):
55165516
return float(start) + _flat_idx * float(step) # noqa: F821 # DSL index/shape symbols resolved by miniexpr
55175517

55185518
if shape is None:
@@ -5545,7 +5545,7 @@ def kernel_ramp(start, step):
55455545
return blosc2.zeros(shape, dtype=dtype, **kwargs) # will return empty array for num == 0
55465546

55475547
# Windows and wasm32 does not support complex numbers in DSL
5548-
if False or blosc2.isdtype(dtype, "complex floating"):
5548+
if blosc2.isdtype(dtype, "complex floating"):
55495549
inputs = (start, stop, num, endpoint)
55505550
lazyarr = blosc2.lazyudf(linspace_fill, inputs, dtype=dtype, shape=(num,))
55515551
if len(shape) == 1:
@@ -5557,7 +5557,7 @@ def kernel_ramp(start, step):
55575557
nitems = num - 1 if endpoint else num
55585558
step = (float(stop) - float(start)) / float(nitems) if nitems > 0 else 0.0
55595559
inputs = (start, step)
5560-
lazyarr = blosc2.lazyudf(kernel_ramp, inputs, dtype=dtype, shape=shape)
5560+
lazyarr = blosc2.lazyudf(ramp_linspace, inputs, dtype=dtype, shape=shape)
55615561
return lazyarr.compute(**kwargs)
55625562

55635563

0 commit comments

Comments
 (0)