Hi
My workflows consist of multiple fireworks, each firework containing only a single task. I’m still learning and figuring things out - so I’m not 100% totally sure I’m doing this the right way.
Currently I need to be able to pass a specific parameter/spec to a firework which only happens to be about the 5th firework in my workflow. At the moment I’d simply do something like this:
firework5 = Firework(FireworkFiveTask(), spec={‘new_param’: ‘123’}, parents=[firework4], name=‘Firework 5’, fw_id=5)
The problem with this is that the new spec defined for this firework will now forget any previous spec information that was passed from firework3 or firework2 and so on.
Is there a way that I can define a spec upfront which carries it’s values throughout each firework in my workflow?
I’ve noticed this in the docs:
update_spec: (dict) A data dict that will update the spec for any remaining FireTasks and the following Firework. Thus, this parameter can be used to pass data between FireTasks or between FireWorks. [1]
Which leads me to believe that the spec data is only passed to the following firework, once. It doesn’t remain constant throughout the many fireworks in my workflow.
Is this correct?
If so, is there anyway that I could give my workflow a spec upfront which gets passed down to each and every firework while updating the spec at the same time?
eg.
firework = Firework(Firework(), spec={‘initial_spec_data’: initial_spec_data}, name=‘Firework’, fw_id=1)
firework1 = Firework(Firework1(), parents=[firework], name=‘Firework1’, fw_id=2)
firework2 = Firework(Firework2(), parents=[firework1], name=‘Firework2’, fw_id=3) # and still have access to ‘initial_spec_data’ in the fw spec here
[1] https://pythonhosted.org/FireWorks/guide_to_writing_firetasks.html
Thanks!