From 1101eca6a50bb832d6812fbe78852dad2f0306cf Mon Sep 17 00:00:00 2001 From: alexamici Date: Wed, 5 Aug 2020 16:27:50 +0200 Subject: [PATCH] Remove all unused and warn-raising methods from AbstractDataStore (#4310) --- xarray/backends/common.py | 45 +-------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/xarray/backends/common.py b/xarray/backends/common.py index 63c4c956f86..da619905ce6 100644 --- a/xarray/backends/common.py +++ b/xarray/backends/common.py @@ -1,8 +1,6 @@ import logging import time import traceback -import warnings -from collections.abc import Mapping import numpy as np @@ -74,18 +72,9 @@ def __array__(self, dtype=None): return np.asarray(self[key], dtype=dtype) -class AbstractDataStore(Mapping): +class AbstractDataStore: __slots__ = () - def __iter__(self): - return iter(self.variables) - - def __getitem__(self, key): - return self.variables[key] - - def __len__(self): - return len(self.variables) - def get_dimensions(self): # pragma: no cover raise NotImplementedError() @@ -125,38 +114,6 @@ def load(self): attributes = FrozenDict(self.get_attrs()) return variables, attributes - @property - def variables(self): # pragma: no cover - warnings.warn( - "The ``variables`` property has been deprecated and " - "will be removed in xarray v0.11.", - FutureWarning, - stacklevel=2, - ) - variables, _ = self.load() - return variables - - @property - def attrs(self): # pragma: no cover - warnings.warn( - "The ``attrs`` property has been deprecated and " - "will be removed in xarray v0.11.", - FutureWarning, - stacklevel=2, - ) - _, attrs = self.load() - return attrs - - @property - def dimensions(self): # pragma: no cover - warnings.warn( - "The ``dimensions`` property has been deprecated and " - "will be removed in xarray v0.11.", - FutureWarning, - stacklevel=2, - ) - return self.get_dimensions() - def close(self): pass