Skip to content

Commit fdc94cb

Browse files
authoredJun 21, 2021
Refine graph implemented in #101. (#108)
1 parent f8feeb7 commit fdc94cb

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed
 

‎docs/changes.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ all releases are available on `PyPI <https://pypi.org/project/pytask>`_ and
2424
- :gh:`94` adds ``--show-locals`` which allows to print local variables in tracebacks.
2525
- :gh:`96` implements a spinner to show the progress during the collection.
2626
- :gh:`99` enables color support in WSL and fixes ``show_locals`` during collection.
27-
- :gh:`101` allows to visualize the project's DAG.
27+
- :gh:`101` implement to visualize the project's DAG. :gh:`108` refines the
28+
implementation.
2829
- :gh:`102` adds an example if a parametrization provides not the number of arguments
2930
specified in the signature.
3031
- :gh:`105` simplifies the logging of the tasks.

‎docs/tutorials/how_to_visualize_the_dag.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
How to visualize the DAG
22
========================
33

4-
pytask offers two interfaces to visualize the :term:`DAG` of your project.
4+
To visualize the :term:`DAG` of the project, first, install `pydot
5+
<https://github.com/pydot/pydot>`_ and `graphviz <https://graphviz.org/>`_. For example,
6+
you can both install with conda
7+
8+
.. code-block:: console
9+
10+
$ conda install -c conda-forge pydot
11+
12+
After that, pytask offers two interfaces to visualize the :term:`DAG` of your project.
513

614

715
Command line interface

‎environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dependencies:
3030
- matplotlib
3131
- pdbpp
3232
- pre-commit
33+
- pydot
3334
- pytest
3435
- pytest-cov
3536
- tox-conda

‎src/_pytask/graph.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,14 @@ def _write_graph(dag: nx.DiGraph, path: Path, layout: str) -> None:
191191
except ImportError:
192192
raise ImportError(
193193
"To visualize the project's DAG you need to install pydot which is "
194-
"available with pip and conda."
194+
"available with pip and conda. For example, use 'conda install -c "
195+
"conda-forge pydot'."
195196
) from None
196197
if shutil.which(layout) is None:
197198
raise RuntimeError(
198-
"The layout program '{layout}' could not be found on your PATH. Please, "
199-
"install graphviz. It is, for example, available with conda."
199+
f"The layout program '{layout}' could not be found on your PATH. Please, "
200+
"install graphviz. For example, use 'conda install -c conda-forge "
201+
"graphivz'."
200202
)
201203

202204
path.parent.mkdir(exist_ok=True, parents=True)

0 commit comments

Comments
 (0)
Please sign in to comment.