Skip to content

Commit 252f7a6

Browse files
committed
future warnings
1 parent 1d54370 commit 252f7a6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ def maybe_promote(dtype):
2020
fill_value : Valid missing value for the promoted dtype.
2121
"""
2222
# N.B. these casting rules should match pandas
23-
if np.issubdtype(dtype, float):
23+
if np.issubdtype(dtype, np.floating):
2424
fill_value = np.nan
25-
elif np.issubdtype(dtype, int):
25+
elif np.issubdtype(dtype, np.signedinteger):
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)