Skip to content

Commit e15f777

Browse files
committed
future warnings
1 parent 1d54370 commit e15f777

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

xarray/conventions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def ensure_dtype_not_object(var, name=None):
351351
fill_value = u''
352352
else:
353353
# insist on using float for numeric values
354-
if not np.issubdtype(inferred_dtype, float):
354+
if not np.issubdtype(inferred_dtype, np.floating):
355355
inferred_dtype = np.dtype(float)
356356
fill_value = inferred_dtype.type(np.nan)
357357

xarray/core/dtypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def maybe_promote(dtype):
2626
# convert to floating point so NaN is valid
2727
dtype = float
2828
fill_value = np.nan
29-
elif np.issubdtype(dtype, complex):
29+
elif np.issubdtype(dtype, np.complexfloating):
3030
fill_value = np.nan + np.nan * 1j
3131
elif np.issubdtype(dtype, np.datetime64):
3232
fill_value = np.datetime64('NaT')

xarray/core/indexing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ def __array__(self, dtype=None):
874874
if isinstance(array, pd.PeriodIndex):
875875
with suppress(AttributeError):
876876
# this might not be public API
877-
array = array.asobject
877+
array = array.astype('object')
878878
return np.asarray(array.values, dtype=dtype)
879879

880880
@property

0 commit comments

Comments
 (0)