@@ -35,47 +35,6 @@ def __getitem__(self, key):
35
35
def __unicode__ (self ):
36
36
return formatting .indexes_repr (self )
37
37
38
- # class Indexes(Mapping, formatting.ReprMixin):
39
- # """Ordered Mapping[str, pandas.Index] for xarray objects.
40
- # """
41
- #
42
- # def __init__(self, variables, sizes):
43
- # """Not for public consumption.
44
- #
45
- # Parameters
46
- # ----------
47
- # variables : OrderedDict[Any, Variable]
48
- # Reference to OrderedDict holding variable objects. Should be the
49
- # same dictionary used by the source object.
50
- # sizes : OrderedDict[Any, int]
51
- # Map from dimension names to sizes.
52
- # """
53
- # self._variables = variables
54
- # self._sizes = sizes
55
- #
56
- # def _is_index_variable(self, key):
57
- # return (key in self._variables and key in self._sizes and
58
- # isinstance(self._variables[key], IndexVariable))
59
- #
60
- # def __iter__(self):
61
- # for key in self._sizes:
62
- # if self._is_index_variable(key):
63
- # yield key
64
- #
65
- # def __len__(self):
66
- # return sum(self._is_index_variable(key) for key in self._sizes)
67
- #
68
- # def __contains__(self, key):
69
- # self._is_index_variable(key)
70
- #
71
- # def __getitem__(self, key):
72
- # if not self._is_index_variable(key):
73
- # raise KeyError(key)
74
- # return self._variables[key].to_index()
75
- #
76
- # def __unicode__(self):
77
- # return formatting.indexes_repr(self)
78
-
79
38
80
39
def default_indexes (coords , dims ):
81
40
"""Default indexes for a Dataset/DataArray.
@@ -93,4 +52,4 @@ def default_indexes(coords, dims):
93
52
to indexes used for indexing along that dimension.
94
53
"""
95
54
return OrderedDict ((key , coords [key ].to_index ())
96
- for key in dims if key in coords )
55
+ for key in dims if key in coords and coords [ key ]. ndim == 1 )
0 commit comments