Skip to content

Commit

Permalink
used code-block to get around ipython issue
Browse files Browse the repository at this point in the history
  • Loading branch information
awicenec committed Oct 25, 2021
1 parent 653cc8a commit 07ba9bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 0 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ def __getattr__(cls, _):
'sphinx.ext.coverage',
'sphinx.ext.imgmath',
'sphinx_rtd_theme',
'IPython.sphinxext.ipython_console_highlighting',
'IPython.sphinxext.ipython_directive',
]
templates_path = ['_templates']
source_suffix = ['.rst', '.md']
Expand Down
13 changes: 9 additions & 4 deletions docs/graph_development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ The test ``daliuge-engine/test/manager/test_scalability`` contains an example of

Simple Hello World graph
^^^^^^^^^^^^^^^^^^^^^^^^
.. highlight:: ipython
:linenothreshold: 5

Like every software framework project we need to describe a Hello World example. This one is straight from the |daliuge| test in ``daliuge-engine/test/apps/test_simple.py``::
Like every software framework project we need to describe a Hello World example. This one is straight from the |daliuge| test in ``daliuge-engine/test/apps/test_simple.py``:

.. code-block:: python
:linenos:
from dlg.apps.simple import HelloWorldApp
from dlg.drop import FileDROP
Expand All @@ -62,6 +63,7 @@ Like every software framework project we need to describe a Hello World example.
f.addProducer(h)
h.execute()
Let's look at this in detail. Lines 1 and 2 import the HelloWorldApp and the FileDROP classes, respectively, both of them are part of the |daliuge| code base. Line 4 instanciates an object from the HelloWorldApp class and assigns an object ID (oid) and a unique ID (uid) to the resulting object. In our example both of them are simply the string ``'h'``. We then instantiate the FileDROP with ``oid = uid = 'f'`` in line 5. In line 6 we add the instance of the FileDROP (f) as an output to the HelloWorldApp drop (h). In line 7 we add the HelloWorldApp drop (h) as a producer for the FileDROP (f). NOTE: It would have been sufficient to have either line 6 or line 7, but just to show the calls we do both here (and it does not break things either). Finally in line 8 we call the execute method of the HelloWorldApp (h). This will trigger the execution of the rest of the graph as well. Note that there was no need to care about any detail at all. In fact it is not even obvious whether anything happend at all when executed. In order to check that let's have a look where the file had been written to::
in [1] print(f.path, f.size)
Expand All @@ -79,7 +81,10 @@ Seems to be what is expected!
Parallel Hello World graph
^^^^^^^^^^^^^^^^^^^^^^^^^^

Now that was fun, but kind of boring. |daliuge| is all about paralellism, thus we'll add a bit of that::
Now that was fun, but kind of boring. |daliuge| is all about paralellism, thus we'll add a bit of that:

.. code-block:: python
:linenos:
from dlg.apps.simple import HelloWorldApp, GenericScatterApp
from dlg.drop import FileDROP, InMemoryDROP
Expand Down

0 comments on commit 07ba9bf

Please sign in to comment.