@@ -60,6 +60,11 @@ def create_test_multiindex():
60
60
return Dataset ({}, {'x' : mindex })
61
61
62
62
63
+ def create_test_multidim_coord_no_index ():
64
+ ds = xr .Dataset ({'a' : ('x' , [1 , 1 ]),
65
+ 'x' : (['x' , 'y' ], [[1 , 1 , 1 , 1 ], [2 , 2 , 2 , 2 ]])})
66
+ return ds
67
+
63
68
class InaccessibleVariableDataStore (backends .InMemoryDataStore ):
64
69
def __init__ (self ):
65
70
super (InaccessibleVariableDataStore , self ).__init__ ()
@@ -176,6 +181,11 @@ def test_repr_period_index(self):
176
181
# check that creating the repr doesn't raise an error #GH645
177
182
repr (data )
178
183
184
+ def test_repr_no_index_on_multidim_coord (self ):
185
+ data = create_test_multidim_coord_no_index ()
186
+ actual = repr (data )
187
+ assert '*' not in actual
188
+
179
189
def test_unicode_data (self ):
180
190
# regression test for GH834
181
191
data = Dataset ({u'foø' : [u'ba®' ]}, attrs = {u'å' : u'∑' })
@@ -252,8 +262,7 @@ def test_constructor(self):
252
262
253
263
def test_constructor_multidim_dimensions (self ):
254
264
# checks related to GH2368, GH2233
255
- ds = xr .Dataset ({'a' : ('x' , 2 * np .arange (100 )),
256
- 'x' : (['x' , 'y' ], np .arange (1000 ).reshape (100 , 10 ))})
265
+ ds = create_test_multidim_coord_no_index ()
257
266
258
267
# dataset should have no indices
259
268
assert not isinstance (ds .variables ['x' ], IndexVariable )
@@ -262,9 +271,6 @@ def test_constructor_multidim_dimensions(self):
262
271
with pytest .raises (KeyError ):
263
272
ds .indexes ['x' ]
264
273
265
- repr (ds )
266
- repr (ds .indexes )
267
-
268
274
def test_constructor_invalid_dims (self ):
269
275
# regression for GH1120
270
276
with pytest .raises (MergeError ):
0 commit comments