Skip to content

Commit 3afe7e2

Browse files
committed
Add xfails for missing np.result_type (fixed by pydata/sparse/pull/261)
1 parent 86ee35c commit 3afe7e2

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

xarray/tests/test_sparse.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,19 @@ def test_variable_property(prop):
9191
(do('conj'), True),
9292
(do('copy'), True),
9393
(do('count'), False),
94-
(do('fillna', 0), True),
94+
param(do('fillna', 0), True,
95+
marks=xfail(reason='Missing implementation for np.result_type')),
9596
(do('get_axis_num', dim='x'), False),
9697
(do('isel', x=slice(2, 4)), True),
9798
(do('isnull'), True),
98-
(do('prod'), False),
99+
param(do('prod'), False,
100+
marks=xfail(reason='Missing implementation for np.result_type')),
99101
(do('roll'), True),
100102
(do('round'), True),
101103
(do('set_dims', dims=('x', 'y', 'z')), True),
102104
(do('stack', dimensions={'flat': ('x', 'y')}), True),
103-
(do('sum'), False),
105+
param(do('sum'), False,
106+
marks=xfail(reason='Missing implementation for np.result_type')),
104107
(do('to_base_variable'), True),
105108
(do('transpose'), True),
106109
(do('unstack', dimensions={'x': {'x1': 5, 'x2': 2}}), True),
@@ -240,6 +243,7 @@ def test_pickle(self):
240243
v2 = pickle.loads(pickle.dumps(v1))
241244
assert_sparse_eq(v1.data, v2.data)
242245

246+
@pytest.mark.xfail(reason="Missing implementation for np.result_type")
243247
def test_missing_values(self):
244248
a = np.array([0, 1, np.nan, 3])
245249
s = COO.from_numpy(a)
@@ -290,7 +294,8 @@ def test_dataarray_property(prop):
290294
(do('diff', 'x'), True),
291295
(do('drop', 'x'), True),
292296
(do('expand_dims', {'z': 2}, axis=2), True),
293-
(do('fillna', 0), True),
297+
param(do('fillna', 0), True,
298+
marks=xfail(reason='Missing implementation for np.result_type')),
294299
(do('get_axis_num', 'x'), False),
295300
(do('get_index', 'x'), False),
296301
# (do('groupby'), False),
@@ -300,15 +305,18 @@ def test_dataarray_property(prop):
300305
(do('isel', {'x': slice(0, 3), 'y': slice(2, 4)}), True),
301306
# (do('isel_points'), False),
302307
(do('isnull'), True),
303-
(do('pipe', np.sum, axis=1), True),
304-
(do('prod'), False),
308+
param(do('pipe', np.sum, axis=1), True,
309+
marks=xfail(reason='Missing implementation for np.result_type')),
310+
param(do('prod'), False,
311+
marks=xfail(reason='Missing implementation for np.result_type')),
305312
(do('reindex', {'x': [1, 2, 3]}), True),
306313
(do('rename', 'foo'), True),
307314
(do('reorder_levels'), True),
308315
# (do('resample'), False),
309316
(do('reset_coords', drop=True), True),
310317
(do('reset_index', 'x'), True),
311-
(do('roll', x=2), True),
318+
param(do('roll', x=2), True,
319+
marks=xfail(reason='Missing implementation for np.result_type')),
312320
# (do('rolling'), False),
313321
# (do('rolling_exp'), False),
314322
(do('round'), True),
@@ -318,7 +326,8 @@ def test_dataarray_property(prop):
318326
(do('shift'), True),
319327
# (do('sortby'), False),
320328
(do('stack', z={'x', 'y'}), True),
321-
(do('sum'), False),
329+
param(do('sum'), False,
330+
marks=xfail(reason='Missing implementation for np.result_type')),
322331
# (do('swap_dims'), True),
323332
(do('transpose'), True),
324333
param(do('argmax'), True,
@@ -447,6 +456,7 @@ def setUp(self):
447456
self.ds_xr = xr.DataArray(self.ds_ar, coords={'x': range(4)},
448457
dims=('x', 'y'), name='foo')
449458

459+
@pytest.mark.xfail(reason='Missing implementation for np.result_type')
450460
def test_to_dataset_roundtrip(self):
451461
x = self.sp_xr
452462
assert_equal(x, x.to_dataset('x').to_array('x'))
@@ -502,6 +512,7 @@ def test_align_outer(self):
502512
assert np.all(a2.coords['x'].data == ['a', 'b', 'c', 'd'])
503513
assert np.all(b2.coords['x'].data == ['a', 'b', 'c', 'd'])
504514

515+
@pytest.mark.xfail(reason='Missing implementation for np.result_type')
505516
def test_concat(self):
506517
ds1 = xr.Dataset(data_vars={'d': self.sp_xr})
507518
ds2 = xr.Dataset(data_vars={'d': self.sp_xr})

0 commit comments

Comments
 (0)