File: test_dask_interop.py

package info (click to toggle)
python-sparse 0.16.0a9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,948 kB
  • sloc: python: 9,959; makefile: 8; sh: 3
file content (12 lines) | stat: -rw-r--r-- 415 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
import sparse

from dask.base import tokenize


def test_deterministic_token():
    a = sparse.COO(data=[1, 2, 3], coords=[10, 20, 30], shape=(40,))
    b = sparse.COO(data=[1, 2, 3], coords=[10, 20, 30], shape=(40,))
    assert tokenize(a) == tokenize(b)
    # One of these things is not like the other....
    c = sparse.COO(data=[1, 2, 4], coords=[10, 20, 30], shape=(40,))
    assert tokenize(a) != tokenize(c)