Skip to content

Commit

Permalink
proper placement of the result_type comment
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Jun 7, 2024
1 parent 4e86aa2 commit c28233c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions xarray/core/duck_array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,12 @@ def as_shared_dtype(scalars_or_arrays, xp=np):

xp = cp

# split into weakly and strongly dtyped
dtype = dtypes.result_type(*scalars_or_arrays, xp=xp)

# Pass arrays directly instead of dtypes to result_type so scalars
# get handled properly.
# Note that result_type() safely gets the dtype from dask arrays without
# evaluating them.
dtype = dtypes.result_type(*scalars_or_arrays, xp=xp)

return tuple(asarray(x, dtype=dtype, xp=xp) for x in scalars_or_arrays)


Expand Down

0 comments on commit c28233c

Please sign in to comment.