Skip to content

Commit dfe601f

Browse files
committed
fix pre-commit and a test
1 parent 7dccf06 commit dfe601f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

dpnp/dpnp_iface_functional.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
3737
"""
3838

39+
# pylint: disable=no-name-in-module
3940
# pylint: disable=protected-access
4041

4142
import dpctl.utils as dpu
@@ -339,9 +340,11 @@ def piecewise(x, condlist, funclist):
339340
dpnp.check_supported_arrays_type(x)
340341
if isinstance(condlist, tuple):
341342
condlist = list(condlist)
342-
if isinstance(condlist, dpnp.ndarray) and condlist.ndim in [0, 1]:
343+
elif isinstance(condlist, dpnp.ndarray) and condlist.ndim in [0, 1]:
343344
condlist = [condlist]
344-
if dpnp.isscalar(condlist) or (dpnp.isscalar(condlist[0]) and x.ndim != 0):
345+
elif dpnp.isscalar(condlist) or (
346+
dpnp.isscalar(condlist[0]) and x.ndim != 0
347+
):
345348
# convert scalar to a list of one array
346349
# convert list of scalars to a list of one array
347350
condlist = [

dpnp/tests/test_functional.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ def test_basic_complex(self, dtype):
9494
ia = dpnp.array(a)
9595
funclist = [-1.5 - 1j * 1.5, 1.5 + 1j * 1.5]
9696

97-
if (
98-
numpy.issubdtype(dtype, numpy.complexfloating)
99-
or dtype == numpy.bool
100-
):
97+
if numpy.issubdtype(dtype, numpy.complexfloating) or dtype == dpnp.bool:
10198
expected = numpy.piecewise(a, [a < 0, a >= 0], funclist)
10299
result = dpnp.piecewise(ia, [ia < 0, ia >= 0], funclist)
103100
assert a.dtype == result.dtype

0 commit comments

Comments
 (0)