diff --git a/dace/__init__.py b/dace/__init__.py index 352e76de3c..c6158c1493 100644 --- a/dace/__init__.py +++ b/dace/__init__.py @@ -15,7 +15,7 @@ from . import data, hooks, subsets from .codegen.compiled_sdfg import CompiledSDFG from .config import Config -from .sdfg import SDFG, SDFGState, InterstateEdge, nodes +from .sdfg import SDFG, SDFGState, InterstateEdge, nodes, ControlFlowRegion from .sdfg.propagation import propagate_memlets_sdfg, propagate_memlet from .memlet import Memlet from .symbolic import symbol diff --git a/dace/sdfg/__init__.py b/dace/sdfg/__init__.py index d3c151fdc4..8e7385670c 100644 --- a/dace/sdfg/__init__.py +++ b/dace/sdfg/__init__.py @@ -1,7 +1,7 @@ # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. from dace.sdfg.sdfg import SDFG, InterstateEdge, LogicalGroup, NestedDict -from dace.sdfg.state import SDFGState +from dace.sdfg.state import SDFGState, ControlFlowRegion from dace.sdfg.scope import (scope_contains_scope, is_devicelevel_gpu, devicelevel_block_size, ScopeSubgraphView) diff --git a/setup.py b/setup.py index fbe95715cb..d4d1de30fe 100644 --- a/setup.py +++ b/setup.py @@ -78,7 +78,7 @@ 'pyreadline;platform_system=="Windows"', 'typing-compat; python_version < "3.8"', 'packaging' ] + cmake_requires, extras_require={ - 'testing': ['coverage', 'pytest-cov', 'scipy', 'absl-py', 'opt_einsum', 'pymlir', 'click'], + 'testing': ['coverage', 'pytest-cov', 'scipy', 'absl-py', 'opt_einsum', 'pymlir', 'click', 'ipykernel', 'nbconvert'], 'docs': ['jinja2<3.2.0', 'sphinx-autodoc-typehints', 'sphinx-rtd-theme>=0.5.1'] }, entry_points={ diff --git a/tests/tutorials/tutorials_test.py b/tests/tutorials/tutorials_test.py new file mode 100644 index 0000000000..974e3c0de9 --- /dev/null +++ b/tests/tutorials/tutorials_test.py @@ -0,0 +1,27 @@ +import nbformat +import pytest +from nbconvert.preprocessors import ExecutePreprocessor, CellExecutionError + +BASE_PATH = "tutorials/" +NOTEBOOK_PATHS = [ + f"{BASE_PATH}getting_started.ipynb", + f"{BASE_PATH}codegen.ipynb", +] + + +@pytest.mark.parametrize("notebook", NOTEBOOK_PATHS) +def test_notebook_exec(notebook): + with open(notebook) as f: + nb = nbformat.read(f, as_version=4) + ep = ExecutePreprocessor(timeout=600) + try: + out = ep.preprocess(nb) + except CellExecutionError: + out = None + msg = 'Error executing the notebook "%s".\n\n' % notebook + print(msg) + raise + + +if __name__ == '__main__': + pytest.main(["-v", __file__]) diff --git a/tutorials/getting_started.ipynb b/tutorials/getting_started.ipynb index 266d207abc..b5d9c000f1 100644 --- a/tutorials/getting_started.ipynb +++ b/tutorials/getting_started.ipynb @@ -404,25 +404,7 @@ ] } ], - "metadata": { - "kernelspec": { - "display_name": "dace_dev", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.0" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 4 }