From ba4b1ed35db1a1af9e8ee90a3e7ebfb62f12bbcd Mon Sep 17 00:00:00 2001
From: "ivan.kondov" <ivan.kondov@kit.edu>
Date: Fri, 14 Jul 2017 15:35:26 +0200
Subject: [PATCH] simplified / adapted Problem 5.2

---
 docs/exercise5.rst | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/docs/exercise5.rst b/docs/exercise5.rst
index 6a22d11..affaf23 100644
--- a/docs/exercise5.rst
+++ b/docs/exercise5.rst
@@ -69,6 +69,14 @@ Here a firework using this firetask::
           optional par: {}
 
 
+**NOTE**: the python module ``custom_tasks`` must be in $PYTHONPATH in order to 
+be correctly registered. For this reason keep the file **custom_tasks.py** either
+in **lib** or in **exercises/work/5_author_firetask** where you start the ``lpad`` 
+and ``rlaunch`` commands. In the latter case you should add that directory to 
+$PYTHONPATH with::
+
+    export PYTHONPATH=`pwd`:$PYTHONPATH
+
 
 Problem 5.1: Data Loader Task
 -----------------------------
@@ -91,9 +99,13 @@ script. The firetask should integrate into the workflow available in
 **dataloader+repeater.json** without further adaptations.
 
 Hint: You can use the ``load_object`` function from 
-``fireworks.utilities.fw_serializers`` to insert a workflow section (sub-workflow) 
+``fireworks.utilities.fw_serializers`` to construct a firework object and 
+the ``detours`` keyword argument of ``FWAction`` `to insert the firework 
 dynamically::
 
-    workflow_obj = load_object(workflow_dict)
-    actions = ['detours': workflow_obj]
-    return FWAction(*actions)
+    firework = Firework(
+        tasks=[load_object(task) for task in fw_spec['_tasks']],
+        spec=fw_spec,
+        name='repeat '+self['measure']
+    )
+    return FWAction(detours=firework)
\ No newline at end of file
-- 
GitLab