From 6416a16fb0f21a0a071fa2423be67036421aef8e Mon Sep 17 00:00:00 2001 From: HasanAhmadQ7 Date: Sun, 21 Jul 2019 05:54:18 +0900 Subject: [PATCH] fix bug: pep8 compatibility line too long --- xarray/core/dataset.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index b8571097be1..fffba81277c 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -2327,13 +2327,14 @@ def interp_like(self, other, method='linear', assume_sorted=False, def _maybe_cast_floats(self, indexers): """ Cast float labels passed to sel() method to the float types of the corresponding coordinates""" - from .dataarray import DataArray + from .dataarray import DataArray casted_indexers = indexers.copy() for k, v in indexers.items(): coords_var = self.coords[k].values if isinstance(indexers[k], (slice, DataArray, Variable)): pass - elif isinstance(coords_var, np.ndarray) and coords_var.dtype.kind == 'f': + elif isinstance(coords_var, np.ndarray) and + coords_var.dtype.kind == 'f': casting_type = getattr(coords_var.dtype, "type") casted_indexers[k] = casting_type(indexers[k]) return casted_indexers