You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/dask/tests/test_highgraph.py

29 lines
579 B

import os
import pytest
import dask.array as da
from dask.utils_test import inc
from dask.highlevelgraph import HighLevelGraph
def test_visualize(tmpdir):
pytest.importorskip('graphviz')
fn = str(tmpdir)
a = da.ones(10, chunks=(5,))
b = a + 1
c = a + 2
d = b + c
d.dask.visualize(fn)
assert os.path.exists(fn)
def test_basic():
a = {'x': 1}
b = {'y': (inc, 'x')}
layers = {'a': a, 'b': b}
dependencies = {'a': set(), 'b': {'a'}}
hg = HighLevelGraph(layers, dependencies)
assert dict(hg) == {'x': 1, 'y': (inc, 'x')}