MCPcopy Index your code
hub / github.com/pydata/xarray / test_1d_variable_method

Function test_1d_variable_method

xarray/tests/test_sparse.py:262–272  ·  view source on GitHub ↗
(func, sparse_output)

Source from the content-addressed store, hash-verified

260 ],
261)
262def test_1d_variable_method(func, sparse_output):
263 var_s = make_xrvar({"x": 10})
264 var_d = xr.Variable(var_s.dims, var_s.data.todense())
265 ret_s = func(var_s)
266 ret_d = func(var_d)
267
268 if sparse_output:
269 assert isinstance(ret_s.data, sparse.SparseArray)
270 assert np.allclose(ret_s.data.todense(), ret_d.data)
271 else:
272 assert np.allclose(ret_s, ret_d)
273
274
275class TestSparseVariable:

Callers

nothing calls this directly

Calls 3

make_xrvarFunction · 0.85
funcFunction · 0.70
todenseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…