Skip to content

Commit

Permalink
Remove all unused and warn-raising methods from AbstractDataStore (#4310
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alexamici authored Aug 5, 2020
1 parent e1dafe6 commit 1101eca
Showing 1 changed file with 1 addition and 44 deletions.
45 changes: 1 addition & 44 deletions xarray/backends/common.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import logging
import time
import traceback
import warnings
from collections.abc import Mapping

import numpy as np

Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 1101eca

Please sign in to comment.