Skip to content

Remove all unused and warn-raising methods from AbstractDataStore #4310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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