-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement deterministic dask tokenization. (#320)
* Test deterministic dask tokenization. * Implement __dask_tokenize__. * Add missing test dependency. * Apply black.
- Loading branch information
1 parent
517a579
commit c7b40a5
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dask[array] | ||
pytest>=3.5 | ||
pytest-black | ||
pytest-cov | ||
pytest-cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from dask.base import tokenize | ||
import sparse | ||
|
||
|
||
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) |