diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 4ae498c3bb7..e1744e28077 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -33,6 +33,8 @@ v0.11.0 (unreleased) Breaking changes ~~~~~~~~~~~~~~~~ +- ``Dataset.T`` has been removed as a shortcut for :py:meth:`Dataset.transpose`. + Call :py:meth:`Dataset.transpose` directly instead. - Iterating over a ``Dataset`` now includes only data variables, not coordinates. Similarily, calling ``len`` and ``bool`` on a ``Dataset`` now includes only data variables diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 534029b9aff..983270cf425 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -916,13 +916,6 @@ def _item_sources(self): return [self.data_vars, self.coords, {d: self[d] for d in self.dims}, LevelCoordinatesSource(self)] - def __dir__(self): - # In order to suppress a deprecation warning in Ipython autocompletion - # .T is explicitly removed from __dir__. GH: issue 1675 - d = super(Dataset, self).__dir__() - d.remove('T') - return d - def __contains__(self, key): """The 'in' operator will return true or false depending on whether 'key' is an array in the dataset or not. @@ -2647,13 +2640,6 @@ def transpose(self, *dims): ds._variables[name] = var.transpose(*var_dims) return ds - @property - def T(self): - warnings.warn('xarray.Dataset.T has been deprecated as an alias for ' - '`.transpose()`. It will be removed in xarray v0.11.', - FutureWarning, stacklevel=2) - return self.transpose() - def dropna(self, dim, how='any', thresh=None, subset=None): """Returns a new dataset with dropped labels for missing values along the provided dimension. diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index adc809662f8..aa226ff1ce8 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -3801,10 +3801,6 @@ def test_dataset_transpose(self): expected = ds.apply(lambda x: x.transpose()) assert_identical(expected, actual) - with pytest.warns(FutureWarning): - actual = ds.T - assert_identical(expected, actual) - actual = ds.transpose('x', 'y') expected = ds.apply(lambda x: x.transpose('x', 'y')) assert_identical(expected, actual)