Skip to content

Commit 1101eca

Browse files
authored
Remove all unused and warn-raising methods from AbstractDataStore (#4310)
1 parent e1dafe6 commit 1101eca

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

xarray/backends/common.py

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import logging
22
import time
33
import traceback
4-
import warnings
5-
from collections.abc import Mapping
64

75
import numpy as np
86

@@ -74,18 +72,9 @@ def __array__(self, dtype=None):
7472
return np.asarray(self[key], dtype=dtype)
7573

7674

77-
class AbstractDataStore(Mapping):
75+
class AbstractDataStore:
7876
__slots__ = ()
7977

80-
def __iter__(self):
81-
return iter(self.variables)
82-
83-
def __getitem__(self, key):
84-
return self.variables[key]
85-
86-
def __len__(self):
87-
return len(self.variables)
88-
8978
def get_dimensions(self): # pragma: no cover
9079
raise NotImplementedError()
9180

@@ -125,38 +114,6 @@ def load(self):
125114
attributes = FrozenDict(self.get_attrs())
126115
return variables, attributes
127116

128-
@property
129-
def variables(self): # pragma: no cover
130-
warnings.warn(
131-
"The ``variables`` property has been deprecated and "
132-
"will be removed in xarray v0.11.",
133-
FutureWarning,
134-
stacklevel=2,
135-
)
136-
variables, _ = self.load()
137-
return variables
138-
139-
@property
140-
def attrs(self): # pragma: no cover
141-
warnings.warn(
142-
"The ``attrs`` property has been deprecated and "
143-
"will be removed in xarray v0.11.",
144-
FutureWarning,
145-
stacklevel=2,
146-
)
147-
_, attrs = self.load()
148-
return attrs
149-
150-
@property
151-
def dimensions(self): # pragma: no cover
152-
warnings.warn(
153-
"The ``dimensions`` property has been deprecated and "
154-
"will be removed in xarray v0.11.",
155-
FutureWarning,
156-
stacklevel=2,
157-
)
158-
return self.get_dimensions()
159-
160117
def close(self):
161118
pass
162119

0 commit comments

Comments
 (0)