Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed May 1, 2022
1 parent 35ed378 commit dfe200d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xarray/core/duck_array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,7 @@ def _timedelta_to_seconds(array):

def py_timedelta_to_float(array, datetime_unit):
"""Convert a timedelta object to a float, possibly at a loss of resolution."""
if not is_duck_array(array):
array = np.asarray(array)
array = asarray(array)
if is_duck_dask_array(array):
array = array.map_blocks(
_timedelta_to_seconds, meta=np.array([], dtype=np.float64)
Expand Down

0 comments on commit dfe200d

Please sign in to comment.