Skip to content

Commit 2c8a607

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f3c2c93 commit 2c8a607

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

xarray/core/duck_array_ops.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,20 @@ def as_shared_dtype(scalars_or_arrays, xp=np):
229229

230230
arrays = [asarray(x, xp=cp) for x in scalars_or_arrays]
231231
else:
232-
#arrays = [asarray(x, xp=xp) for x in scalars_or_arrays]
233-
arrays = [x if isinstance(x, (int, float, complex)) else asarray(x, xp=xp) for x in scalars_or_arrays]
232+
# arrays = [asarray(x, xp=xp) for x in scalars_or_arrays]
233+
arrays = [
234+
x if isinstance(x, (int, float, complex)) else asarray(x, xp=xp)
235+
for x in scalars_or_arrays
236+
]
234237
# Pass arrays directly instead of dtypes to result_type so scalars
235238
# get handled properly.
236239
# Note that result_type() safely gets the dtype from dask arrays without
237240
# evaluating them.
238241
out_type = dtypes.result_type(*arrays)
239-
#return [astype(x, out_type, copy=False) for x in arrays]
240-
return [astype(x, out_type, copy=False) if hasattr(x, "dtype") else x for x in arrays]
242+
# return [astype(x, out_type, copy=False) for x in arrays]
243+
return [
244+
astype(x, out_type, copy=False) if hasattr(x, "dtype") else x for x in arrays
245+
]
241246

242247

243248
def broadcast_to(array, shape):

0 commit comments

Comments
 (0)