Using PyTask

Hi,

I’d like to use PyTask to execute custom functions.

Using the very simple Workflow from the doc, I have this:

~/working$ ls
fireworks test-wf.py

~/working$ cat test-wf.py
import sys
sys.path.insert(0, “fireworks”)
from fireworks import Firework, Workflow, LaunchPad, ScriptTask, PyTask
from fireworks.core.rocket_launcher import rapidfire

set up the LaunchPad and reset it

launchpad = LaunchPad()
launchpad.reset(’’, require_password=False)

create the individual FireWorks and Workflow

fw1 = Firework(ScriptTask.from_str(‘echo hello’), name=“hello”)
fw2 = Firework(ScriptTask.from_str(‘echo goodbye’), name=“goodbye”)
fw_timer = Firework(PyTask(func=‘time.sleep’,args=[5]))
wf = Workflow([fw1, fw2, fw_timer], {fw1:fw_timer, fw_timer: fw2}, name=“test workflow”)

store workflow and launch it locally

launchpad.add_wf(wf)
rapidfire(launchpad)

~/working$ python3 test-wf.py
2019-01-23 10:53:15,208 INFO Performing db tune-up
2019-01-23 10:53:15,215 INFO LaunchPad was RESET.
2019-01-23 10:53:15,218 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}
2019-01-23 10:53:15,287 INFO Created new dir /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,287 INFO Launching Rocket
2019-01-23 10:53:15,299 INFO RUNNING fw_id: 3 in directory: /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,308 INFO Task started: ScriptTask.
hello
2019-01-23 10:53:15,314 INFO Task completed: ScriptTask
Traceback (most recent call last):
File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf
updated_ids = wf.refresh(fw_id)
File “fireworks/fireworks/core/firework.py”, line 1011, in refresh
updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))
File “fireworks/fireworks/core/firework.py”, line 974, in refresh
if fw.spec.get(’_allow_fizzled_parents’):
File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec
return self.partial_fw.spec
File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw
self._fw = Firework.from_dict(data)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load
return load_object(obj)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object
raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))
ValueError: load_object() could not find a class with cls._fw_name PyTask

I also tried others imports:

from fireworks.user_objects.firetasks.script_task import PyTask

or:

import fireworks.user_objects.firetasks.script_task

How should I do?

(And why is the documentation so unclear?)

Further analysis:

it seems that the problem is in fw_serializers.py. When using PyTask, one of the generator return nothing: we never enter into this for loop:

for _, mod_name, is_pkg in pkgutil.walk_packages(root_module.path, package + ‘.’):

The code enters this loop when looking for Script_task, so I don’t understand why it’s not working for PyTask. Any idea?

···

Le mercredi 23 janvier 2019 10:57:22 UTC+1, Leip a écrit :

Hi,

I’d like to use PyTask to execute custom functions.

Using the very simple Workflow from the doc, I have this:

~/working$ ls
fireworks test-wf.py

~/working$ cat test-wf.py
import sys
sys.path.insert(0, “fireworks”)
from fireworks import Firework, Workflow, LaunchPad, ScriptTask, PyTask
from fireworks.core.rocket_launcher import rapidfire

set up the LaunchPad and reset it

launchpad = LaunchPad()
launchpad.reset(’’, require_password=False)

create the individual FireWorks and Workflow

fw1 = Firework(ScriptTask.from_str(‘echo hello’), name=“hello”)
fw2 = Firework(ScriptTask.from_str(‘echo goodbye’), name=“goodbye”)
fw_timer = Firework(PyTask(func=‘time.sleep’,args=[5]))
wf = Workflow([fw1, fw2, fw_timer], {fw1:fw_timer, fw_timer: fw2}, name=“test workflow”)

store workflow and launch it locally

launchpad.add_wf(wf)
rapidfire(launchpad)

~/working$ python3 test-wf.py
2019-01-23 10:53:15,208 INFO Performing db tune-up
2019-01-23 10:53:15,215 INFO LaunchPad was RESET.
2019-01-23 10:53:15,218 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}
2019-01-23 10:53:15,287 INFO Created new dir /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,287 INFO Launching Rocket
2019-01-23 10:53:15,299 INFO RUNNING fw_id: 3 in directory: /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,308 INFO Task started: ScriptTask.
hello
2019-01-23 10:53:15,314 INFO Task completed: ScriptTask
Traceback (most recent call last):
File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf
updated_ids = wf.refresh(fw_id)
File “fireworks/fireworks/core/firework.py”, line 1011, in refresh
updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))
File “fireworks/fireworks/core/firework.py”, line 974, in refresh
if fw.spec.get(’_allow_fizzled_parents’):
File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec
return self.partial_fw.spec
File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw
self._fw = Firework.from_dict(data)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load
return load_object(obj)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object
raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))
ValueError: load_object() could not find a class with cls._fw_name PyTask

I also tried others imports:

from fireworks.user_objects.firetasks.script_task import PyTask

or:

import fireworks.user_objects.firetasks.script_task

How should I do?

(And why is the documentation so unclear?)

Hi Leip

Can you say how you installed FireWorks? Also what version? (“lpad version”)

I ran your “test_wf.py” code verbatim and didn’t have any problems. Note that the first two lines were included but are unnecessary(?)


(py37) computron-7:~ ajain$ cat test_wf.py

import sys

sys.path.insert(0, "fireworks")

from fireworks import Firework, Workflow, LaunchPad, ScriptTask, PyTask

from fireworks.core.rocket_launcher import rapidfire

# set up the LaunchPad and reset it

launchpad = LaunchPad()

launchpad.reset('', require_password=False)

# create the individual FireWorks and Workflow

fw1 = Firework(ScriptTask.from_str('echo hello'), name="hello")

fw2 = Firework(ScriptTask.from_str('echo goodbye'), name="goodbye")

fw_timer = Firework(PyTask(func='time.sleep',args=[5]))

wf = Workflow([fw1, fw2, fw_timer], {fw1:fw_timer, fw_timer: fw2}, name="test workflow")

# store workflow and launch it locally

launchpad.add_wf(wf)

rapidfire(launchpad)

(py37) computron-7:~ ajain$ python test_wf.py

2019-01-23 14:57:57,739 INFO Performing db tune-up

2019-01-23 14:57:57,747 INFO LaunchPad was RESET.

2019-01-23 14:57:57,749 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}

2019-01-23 14:57:57,789 INFO Created new dir /Users/ajain/launcher_2019-01-23-22-57-57-789290

2019-01-23 14:57:57,789 INFO Launching Rocket

2019-01-23 14:57:58,040 INFO RUNNING fw_id: 3 in directory: /Users/ajain/launcher_2019-01-23-22-57-57-789290

2019-01-23 14:57:58,045 INFO Task started: ScriptTask.

hello

2019-01-23 14:57:58,050 INFO Task completed: ScriptTask

2019-01-23 14:57:58,073 INFO Rocket finished

2019-01-23 14:57:58,075 INFO Created new dir /Users/ajain/launcher_2019-01-23-22-57-58-075675

2019-01-23 14:57:58,076 INFO Launching Rocket

2019-01-23 14:57:58,085 INFO RUNNING fw_id: 1 in directory: /Users/ajain/launcher_2019-01-23-22-57-58-075675

2019-01-23 14:57:58,091 INFO Task started: PyTask.

2019-01-23 14:58:03,092 INFO Task completed: PyTask

2019-01-23 14:58:03,104 INFO Rocket finished

2019-01-23 14:58:03,109 INFO Created new dir /Users/ajain/launcher_2019-01-23-22-58-03-107266

2019-01-23 14:58:03,109 INFO Launching Rocket

2019-01-23 14:58:03,119 INFO RUNNING fw_id: 2 in directory: /Users/ajain/launcher_2019-01-23-22-58-03-107266

2019-01-23 14:58:03,123 INFO Task started: ScriptTask.

goodbye

2019-01-23 14:58:03,128 INFO Task completed: ScriptTask

2019-01-23 14:58:03,141 INFO Rocket finished

···

On Wed, Jan 23, 2019 at 6:49 AM Leip [email protected] wrote:

Further analysis:

it seems that the problem is in fw_serializers.py. When using PyTask, one of the generator return nothing: we never enter into this for loop:

for _, mod_name, is_pkg in pkgutil.walk_packages(root_module.path, package + ‘.’):

The code enters this loop when looking for Script_task, so I don’t understand why it’s not working for PyTask. Any idea?

Le mercredi 23 janvier 2019 10:57:22 UTC+1, Leip a écrit :

Hi,

I’d like to use PyTask to execute custom functions.

Using the very simple Workflow from the doc, I have this:

~/working$ ls
fireworks test-wf.py

~/working$ cat test-wf.py
import sys
sys.path.insert(0, “fireworks”)
from fireworks import Firework, Workflow, LaunchPad, ScriptTask, PyTask
from fireworks.core.rocket_launcher import rapidfire

set up the LaunchPad and reset it

launchpad = LaunchPad()
launchpad.reset(’’, require_password=False)

create the individual FireWorks and Workflow

fw1 = Firework(ScriptTask.from_str(‘echo hello’), name=“hello”)
fw2 = Firework(ScriptTask.from_str(‘echo goodbye’), name=“goodbye”)
fw_timer = Firework(PyTask(func=‘time.sleep’,args=[5]))
wf = Workflow([fw1, fw2, fw_timer], {fw1:fw_timer, fw_timer: fw2}, name=“test workflow”)

store workflow and launch it locally

launchpad.add_wf(wf)
rapidfire(launchpad)

~/working$ python3 test-wf.py
2019-01-23 10:53:15,208 INFO Performing db tune-up
2019-01-23 10:53:15,215 INFO LaunchPad was RESET.
2019-01-23 10:53:15,218 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}
2019-01-23 10:53:15,287 INFO Created new dir /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,287 INFO Launching Rocket
2019-01-23 10:53:15,299 INFO RUNNING fw_id: 3 in directory: /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,308 INFO Task started: ScriptTask.
hello
2019-01-23 10:53:15,314 INFO Task completed: ScriptTask
Traceback (most recent call last):
File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf
updated_ids = wf.refresh(fw_id)
File “fireworks/fireworks/core/firework.py”, line 1011, in refresh
updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))
File “fireworks/fireworks/core/firework.py”, line 974, in refresh
if fw.spec.get(’_allow_fizzled_parents’):
File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec
return self.partial_fw.spec
File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw
self._fw = Firework.from_dict(data)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load
return load_object(obj)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object
raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))
ValueError: load_object() could not find a class with cls._fw_name PyTask

I also tried others imports:

from fireworks.user_objects.firetasks.script_task import PyTask

or:

import fireworks.user_objects.firetasks.script_task

How should I do?

(And why is the documentation so unclear?)

You received this message because you are subscribed to the Google Groups “fireworkflows” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

Visit this group at https://groups.google.com/group/fireworkflows.

For more options, visit https://groups.google.com/d/optout.


Best,
Anubhav

Hi

I’m using the latest version from https://github.com/materialsproject/fireworks (v1.8.4).

···

++

Le mercredi 23 janvier 2019 10:57:22 UTC+1, Leip a écrit :

Hi,

I’d like to use PyTask to execute custom functions.

Using the very simple Workflow from the doc, I have this:

~/working$ ls
fireworks test-wf.py

~/working$ cat test-wf.py
import sys
sys.path.insert(0, “fireworks”)
from fireworks import Firework, Workflow, LaunchPad, ScriptTask, PyTask
from fireworks.core.rocket_launcher import rapidfire

set up the LaunchPad and reset it

launchpad = LaunchPad()
launchpad.reset(’’, require_password=False)

create the individual FireWorks and Workflow

fw1 = Firework(ScriptTask.from_str(‘echo hello’), name=“hello”)
fw2 = Firework(ScriptTask.from_str(‘echo goodbye’), name=“goodbye”)
fw_timer = Firework(PyTask(func=‘time.sleep’,args=[5]))
wf = Workflow([fw1, fw2, fw_timer], {fw1:fw_timer, fw_timer: fw2}, name=“test workflow”)

store workflow and launch it locally

launchpad.add_wf(wf)
rapidfire(launchpad)

~/working$ python3 test-wf.py
2019-01-23 10:53:15,208 INFO Performing db tune-up
2019-01-23 10:53:15,215 INFO LaunchPad was RESET.
2019-01-23 10:53:15,218 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}
2019-01-23 10:53:15,287 INFO Created new dir /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,287 INFO Launching Rocket
2019-01-23 10:53:15,299 INFO RUNNING fw_id: 3 in directory: /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,308 INFO Task started: ScriptTask.
hello
2019-01-23 10:53:15,314 INFO Task completed: ScriptTask
Traceback (most recent call last):
File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf
updated_ids = wf.refresh(fw_id)
File “fireworks/fireworks/core/firework.py”, line 1011, in refresh
updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))
File “fireworks/fireworks/core/firework.py”, line 974, in refresh
if fw.spec.get(’_allow_fizzled_parents’):
File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec
return self.partial_fw.spec
File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw
self._fw = Firework.from_dict(data)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load
return load_object(obj)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object
raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))
ValueError: load_object() could not find a class with cls._fw_name PyTask

I also tried others imports:

from fireworks.user_objects.firetasks.script_task import PyTask

or:

import fireworks.user_objects.firetasks.script_task

How should I do?

(And why is the documentation so unclear?)

Funny thing: it’s working well if I install Fireworks via pip (same version 1.8.4)

···

Le mercredi 23 janvier 2019 10:57:22 UTC+1, Leip a écrit :

Hi,

I’d like to use PyTask to execute custom functions.

Using the very simple Workflow from the doc, I have this:

~/working$ ls
fireworks test-wf.py

~/working$ cat test-wf.py
import sys
sys.path.insert(0, “fireworks”)
from fireworks import Firework, Workflow, LaunchPad, ScriptTask, PyTask
from fireworks.core.rocket_launcher import rapidfire

set up the LaunchPad and reset it

launchpad = LaunchPad()
launchpad.reset(’’, require_password=False)

create the individual FireWorks and Workflow

fw1 = Firework(ScriptTask.from_str(‘echo hello’), name=“hello”)
fw2 = Firework(ScriptTask.from_str(‘echo goodbye’), name=“goodbye”)
fw_timer = Firework(PyTask(func=‘time.sleep’,args=[5]))
wf = Workflow([fw1, fw2, fw_timer], {fw1:fw_timer, fw_timer: fw2}, name=“test workflow”)

store workflow and launch it locally

launchpad.add_wf(wf)
rapidfire(launchpad)

~/working$ python3 test-wf.py
2019-01-23 10:53:15,208 INFO Performing db tune-up
2019-01-23 10:53:15,215 INFO LaunchPad was RESET.
2019-01-23 10:53:15,218 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}
2019-01-23 10:53:15,287 INFO Created new dir /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,287 INFO Launching Rocket
2019-01-23 10:53:15,299 INFO RUNNING fw_id: 3 in directory: /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,308 INFO Task started: ScriptTask.
hello
2019-01-23 10:53:15,314 INFO Task completed: ScriptTask
Traceback (most recent call last):
File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf
updated_ids = wf.refresh(fw_id)
File “fireworks/fireworks/core/firework.py”, line 1011, in refresh
updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))
File “fireworks/fireworks/core/firework.py”, line 974, in refresh
if fw.spec.get(’_allow_fizzled_parents’):
File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec
return self.partial_fw.spec
File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw
self._fw = Firework.from_dict(data)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load
return load_object(obj)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object
raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))
ValueError: load_object() could not find a class with cls._fw_name PyTask

I also tried others imports:

from fireworks.user_objects.firetasks.script_task import PyTask

or:

import fireworks.user_objects.firetasks.script_task

How should I do?

(And why is the documentation so unclear?)

Hi,

For the github install: after downloading v1.8.4, what command did you run to install?

e.g. “python setup.py install” or “python setup.py develop”, etc?

Also, do the unit tests pass for the Github install? (start a MongoDB server and run python setup.py test)

···

Best,
Anubhav

I used python setup.py develop

The test seems ok (ran 156 tests, OK (skipped=8)

···

Le mercredi 23 janvier 2019 10:57:22 UTC+1, Leip a écrit :

Hi,

I’d like to use PyTask to execute custom functions.

Using the very simple Workflow from the doc, I have this:

~/working$ ls
fireworks test-wf.py

~/working$ cat test-wf.py
import sys
sys.path.insert(0, “fireworks”)
from fireworks import Firework, Workflow, LaunchPad, ScriptTask, PyTask
from fireworks.core.rocket_launcher import rapidfire

set up the LaunchPad and reset it

launchpad = LaunchPad()
launchpad.reset(’’, require_password=False)

create the individual FireWorks and Workflow

fw1 = Firework(ScriptTask.from_str(‘echo hello’), name=“hello”)
fw2 = Firework(ScriptTask.from_str(‘echo goodbye’), name=“goodbye”)
fw_timer = Firework(PyTask(func=‘time.sleep’,args=[5]))
wf = Workflow([fw1, fw2, fw_timer], {fw1:fw_timer, fw_timer: fw2}, name=“test workflow”)

store workflow and launch it locally

launchpad.add_wf(wf)
rapidfire(launchpad)

~/working$ python3 test-wf.py
2019-01-23 10:53:15,208 INFO Performing db tune-up
2019-01-23 10:53:15,215 INFO LaunchPad was RESET.
2019-01-23 10:53:15,218 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}
2019-01-23 10:53:15,287 INFO Created new dir /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,287 INFO Launching Rocket
2019-01-23 10:53:15,299 INFO RUNNING fw_id: 3 in directory: /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,308 INFO Task started: ScriptTask.
hello
2019-01-23 10:53:15,314 INFO Task completed: ScriptTask
Traceback (most recent call last):
File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf
updated_ids = wf.refresh(fw_id)
File “fireworks/fireworks/core/firework.py”, line 1011, in refresh
updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))
File “fireworks/fireworks/core/firework.py”, line 974, in refresh
if fw.spec.get(’_allow_fizzled_parents’):
File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec
return self.partial_fw.spec
File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw
self._fw = Firework.from_dict(data)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load
return load_object(obj)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object
raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))
ValueError: load_object() could not find a class with cls._fw_name PyTask

I also tried others imports:

from fireworks.user_objects.firetasks.script_task import PyTask

or:

import fireworks.user_objects.firetasks.script_task

How should I do?

(And why is the documentation so unclear?)

Ok

I just created an empty conda environment, did a clean clone of FireWorks, and python setup.py develop

Here is what I found:

  • The script you sent does not work as-is - I get the same error as you

  • But, if you remove the first two lines of your script (import sys; sys.path.insert(0, “fireworks”)) it works fine for me.

Can you tell me the purpose of those first two lines and why you need them?

Here is the full detailed inputs and outputs. Note that the first time I ran your script, it was as-is and producing the errors, the second time is after removing those first two lines.

···

==========

computron-7:~ ajain$ mkdir test_fws

computron-7:~ ajain$ cd test_fws/

computron-7:test_fws ajain$ cp …/test_wf.py .

computron-7:test_fws ajain$ conda create --name fws_test_env python=3.7

Solving environment: done

Package Plan

environment location: /Users/ajain/miniconda3/envs/fws_test_env

added / updated specs:

  • python=3.7

The following packages will be downloaded:

package | build

---------------------------|-----------------

python-3.7.2 | haf84260_0 21.6 MB

libedit-3.1.20181209 | hb402a30_0 159 KB

ca-certificates-2018.12.5 | 0 123 KB


Total: 21.9 MB

The following NEW packages will be INSTALLED:

ca-certificates: 2018.12.5-0

certifi: 2018.11.29-py37_0

libcxx: 4.0.1-hcfea43d_1

libcxxabi: 4.0.1-hcfea43d_1

libedit: 3.1.20181209-hb402a30_0

libffi: 3.2.1-h475c297_4

ncurses: 6.1-h0a44026_1

openssl: 1.1.1a-h1de35cc_0

pip: 18.1-py37_0

python: 3.7.2-haf84260_0

readline: 7.0-h1de35cc_5

setuptools: 40.6.3-py37_0

sqlite: 3.26.0-ha441bb4_0

tk: 8.6.8-ha441bb4_0

wheel: 0.32.3-py37_0

xz: 5.2.4-h1de35cc_4

zlib: 1.2.11-h1de35cc_3

Proceed ([y]/n)? y

Downloading and Extracting Packages

python-3.7.2 | 21.6 MB | ############################################################################# | 100%

libedit-3.1.20181209 | 159 KB | ############################################################################# | 100%

ca-certificates-2018 | 123 KB | ############################################################################# | 100%

Preparing transaction: done

Verifying transaction: done

Executing transaction: done

To activate this environment, use

$ conda activate fws_test_env

To deactivate an active environment, use

$ conda deactivate

computron-7:test_fws ajain$ conda activate fws_test_env

(fws_test_env) computron-7:test_fws ajain$ git clone [email protected]:materialsproject/fireworks.git

Cloning into ‘fireworks’…

remote: Enumerating objects: 360, done.

remote: Counting objects: 100% (360/360), done.

remote: Compressing objects: 100% (153/153), done.

remote: Total 23630 (delta 277), reused 249 (delta 207), pack-reused 23270

Receiving objects: 100% (23630/23630), 18.02 MiB | 8.16 MiB/s, done.

Resolving deltas: 100% (16863/16863), done.

(fws_test_env) computron-7:test_fws ajain$ cd fireworks/

(fws_test_env) computron-7:fireworks ajain$ python setup.py develop

running develop

running egg_info

creating FireWorks.egg-info

writing FireWorks.egg-info/PKG-INFO

writing dependency_links to FireWorks.egg-info/dependency_links.txt

writing entry points to FireWorks.egg-info/entry_points.txt

writing requirements to FireWorks.egg-info/requires.txt

writing top-level names to FireWorks.egg-info/top_level.txt

writing manifest file ‘FireWorks.egg-info/SOURCES.txt’

reading manifest file ‘FireWorks.egg-info/SOURCES.txt’

reading manifest template ‘MANIFEST.in’

warning: no previously-included files matching ‘*.pyc’ found under directory ‘fireworks’

warning: no previously-included files matching ‘*.pyc’ found under directory ‘docs’

warning: no previously-included files matching ‘*.pyc’ found under directory ‘fw_tutorials’

writing manifest file ‘FireWorks.egg-info/SOURCES.txt’

running build_ext

Creating /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/FireWorks.egg-link (link to .)

Adding FireWorks 1.8.4 to easy-install.pth file

Installing lpad script to /Users/ajain/miniconda3/envs/fws_test_env/bin

Installing mlaunch script to /Users/ajain/miniconda3/envs/fws_test_env/bin

Installing qlaunch script to /Users/ajain/miniconda3/envs/fws_test_env/bin

Installing rlaunch script to /Users/ajain/miniconda3/envs/fws_test_env/bin

Installed /Users/ajain/test_fws/fireworks

Processing dependencies for FireWorks==1.8.4

Searching for tqdm>=4.8.4

Reading https://pypi.org/simple/tqdm/

Downloading https://files.pythonhosted.org/packages/ed/d6/3458d39cf4978f4ece846295e83daf5ece710ab0a4106774f7f7b3a68697/tqdm-4.29.1-py2.py3-none-any.whl#sha256=c9b9b5eeba13994a4c266aae7eef7aeeb0ba2973e431027e942b4faea139ef49

Best match: tqdm 4.29.1

Processing tqdm-4.29.1-py2.py3-none-any.whl

Installing tqdm-4.29.1-py2.py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

Adding tqdm 4.29.1 to easy-install.pth file

Installing tqdm script to /Users/ajain/miniconda3/envs/fws_test_env/bin

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/tqdm-4.29.1-py3.7.egg

Searching for gunicorn>=19.6.0

Reading https://pypi.org/simple/gunicorn/

Downloading https://files.pythonhosted.org/packages/8c/da/b8dd8deb741bff556db53902d4706774c8e1e67265f69528c14c003644e6/gunicorn-19.9.0-py2.py3-none-any.whl#sha256=aa8e0b40b4157b36a5df5e599f45c9c76d6af43845ba3b3b0efe2c70473c2471

Best match: gunicorn 19.9.0

Processing gunicorn-19.9.0-py2.py3-none-any.whl

Installing gunicorn-19.9.0-py2.py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

writing requirements to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/gunicorn-19.9.0-py3.7.egg/EGG-INFO/requires.txt

Adding gunicorn 19.9.0 to easy-install.pth file

Installing gunicorn script to /Users/ajain/miniconda3/envs/fws_test_env/bin

Installing gunicorn_paster script to /Users/ajain/miniconda3/envs/fws_test_env/bin

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/gunicorn-19.9.0-py3.7.egg

Searching for flask-paginate>=0.4.5

Reading https://pypi.org/simple/flask-paginate/

Downloading https://files.pythonhosted.org/packages/fc/95/d7d61640893050a55365ffba33885883495c0838a05f11984336aa023f00/flask-paginate-0.5.1.tar.gz#sha256=b68e8d7664419ad53728514139811bce9c3f2e56199a6c057ef4c08f9f35f35d

Best match: flask-paginate 0.5.1

Processing flask-paginate-0.5.1.tar.gz

Writing /var/folders/90/ntqv188927lgzsjpt6f_p4_80000gn/T/easy_install-xjc7w6qh/flask-paginate-0.5.1/setup.cfg

Running flask-paginate-0.5.1/setup.py -q bdist_egg --dist-dir /var/folders/90/ntqv188927lgzsjpt6f_p4_80000gn/T/easy_install-xjc7w6qh/flask-paginate-0.5.1/egg-dist-tmp-qd21e8my

creating /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/flask_paginate-0.5.1-py3.7.egg

Extracting flask_paginate-0.5.1-py3.7.egg to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

Adding flask-paginate 0.5.1 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/flask_paginate-0.5.1-py3.7.egg

Searching for flask>=0.11.1

Reading https://pypi.org/simple/flask/

Downloading https://files.pythonhosted.org/packages/7f/e7/08578774ed4536d3242b14dacb4696386634607af824ea997202cd0edb4b/Flask-1.0.2-py2.py3-none-any.whl#sha256=a080b744b7e345ccfcbc77954861cb05b3c63786e93f2b3875e0913d44b43f05

Best match: Flask 1.0.2

Processing Flask-1.0.2-py2.py3-none-any.whl

Installing Flask-1.0.2-py2.py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

writing requirements to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/Flask-1.0.2-py3.7.egg/EGG-INFO/requires.txt

Adding Flask 1.0.2 to easy-install.pth file

Installing flask script to /Users/ajain/miniconda3/envs/fws_test_env/bin

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/Flask-1.0.2-py3.7.egg

Searching for tabulate>=0.7.5

Reading https://pypi.org/simple/tabulate/

Downloading https://files.pythonhosted.org/packages/12/c2/11d6845db5edf1295bc08b2f488cf5937806586afe42936c3f34c097ebdc/tabulate-0.8.2.tar.gz#sha256=e4ca13f26d0a6be2a2915428dc21e732f1e44dad7f76d7030b2ef1ec251cf7f2

Best match: tabulate 0.8.2

Processing tabulate-0.8.2.tar.gz

Writing /var/folders/90/ntqv188927lgzsjpt6f_p4_80000gn/T/easy_install-1wgdm28h/tabulate-0.8.2/setup.cfg

Running tabulate-0.8.2/setup.py -q bdist_egg --dist-dir /var/folders/90/ntqv188927lgzsjpt6f_p4_80000gn/T/easy_install-1wgdm28h/tabulate-0.8.2/egg-dist-tmp-257z8jrx

zip_safe flag not set; analyzing archive contents…

Copying tabulate-0.8.2-py3.7.egg to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

Adding tabulate 0.8.2 to easy-install.pth file

Installing tabulate script to /Users/ajain/miniconda3/envs/fws_test_env/bin

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/tabulate-0.8.2-py3.7.egg

Searching for python-dateutil>=2.5.3

Reading https://pypi.org/simple/python-dateutil/

Downloading https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl#sha256=063df5763652e21de43de7d9e00ccf239f953a832941e37be541614732cdfc93

Best match: python-dateutil 2.7.5

Processing python_dateutil-2.7.5-py2.py3-none-any.whl

Installing python_dateutil-2.7.5-py2.py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

writing requirements to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/python_dateutil-2.7.5-py3.7.egg/EGG-INFO/requires.txt

Adding python-dateutil 2.7.5 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/python_dateutil-2.7.5-py3.7.egg

Searching for monty>=1.0.1

Reading https://pypi.org/simple/monty/

Downloading https://files.pythonhosted.org/packages/37/32/1766195d89398fa070a5098e462907f31154881d6381746c25b69f1c2fdc/monty-1.0.5-py3-none-any.whl#sha256=e860c905c5e6e3e5c0957e3e0faa983da20c4854c88cd515bb5a4600cd198fa8

Best match: monty 1.0.5

Processing monty-1.0.5-py3-none-any.whl

Installing monty-1.0.5-py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

writing requirements to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/monty-1.0.5-py3.7.egg/EGG-INFO/requires.txt

Adding monty 1.0.5 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/monty-1.0.5-py3.7.egg

Searching for six>=1.10.0

Reading https://pypi.org/simple/six/

Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl#sha256=3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c

Best match: six 1.12.0

Processing six-1.12.0-py2.py3-none-any.whl

Installing six-1.12.0-py2.py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

Adding six 1.12.0 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/six-1.12.0-py3.7.egg

Searching for Jinja2>=2.8.0

Reading https://pypi.org/simple/Jinja2/

Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl#sha256=74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd

Best match: Jinja2 2.10

Processing Jinja2-2.10-py2.py3-none-any.whl

Installing Jinja2-2.10-py2.py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

writing requirements to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/Jinja2-2.10-py3.7.egg/EGG-INFO/requires.txt

Adding Jinja2 2.10 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/Jinja2-2.10-py3.7.egg

Searching for pymongo>=3.3.0

Reading https://pypi.org/simple/pymongo/

Downloading https://files.pythonhosted.org/packages/d7/ac/d2e324c1f9bcf653fa106785371a16b4709506a35b04948655de8b961a85/pymongo-3.7.2-cp37-cp37m-macosx_10_9_x86_64.whl#sha256=1826527a0b032f6e20e7ac7f72d7c26dd476a5e5aa82c04aa1c7088a59fded7d

Best match: pymongo 3.7.2

Processing pymongo-3.7.2-cp37-cp37m-macosx_10_9_x86_64.whl

Installing pymongo-3.7.2-cp37-cp37m-macosx_10_9_x86_64.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

writing requirements to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/pymongo-3.7.2-py3.7-macosx-10.7-x86_64.egg/EGG-INFO/requires.txt

Adding pymongo 3.7.2 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/pymongo-3.7.2-py3.7-macosx-10.7-x86_64.egg

Searching for ruamel.yaml>=0.15.35

Reading https://pypi.org/simple/ruamel.yaml/

Downloading https://files.pythonhosted.org/packages/43/6e/aa168badc6dc6c2894b5dfec3352d1beed3ecf1f41fab3e1c7fd36b883ca/ruamel.yaml-0.15.87-cp37-cp37m-macosx_10_9_x86_64.whl#sha256=5dd0ea7c5c703e8675f3caf2898a50b4dadaa52838f8e104637a452a05e03030

Best match: ruamel.yaml 0.15.87

Processing ruamel.yaml-0.15.87-cp37-cp37m-macosx_10_9_x86_64.whl

Installing ruamel.yaml-0.15.87-cp37-cp37m-macosx_10_9_x86_64.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

writing requirements to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/ruamel.yaml-0.15.87-py3.7-macosx-10.7-x86_64.egg/EGG-INFO/requires.txt

Adding ruamel.yaml 0.15.87 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/ruamel.yaml-0.15.87-py3.7-macosx-10.7-x86_64.egg

Searching for itsdangerous>=0.24

Reading https://pypi.org/simple/itsdangerous/

Downloading https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl#sha256=b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749

Best match: itsdangerous 1.1.0

Processing itsdangerous-1.1.0-py2.py3-none-any.whl

Installing itsdangerous-1.1.0-py2.py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

Adding itsdangerous 1.1.0 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/itsdangerous-1.1.0-py3.7.egg

Searching for click>=5.1

Reading https://pypi.org/simple/click/

Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl#sha256=2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13

Best match: Click 7.0

Processing Click-7.0-py2.py3-none-any.whl

Installing Click-7.0-py2.py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

Adding Click 7.0 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/Click-7.0-py3.7.egg

Searching for Werkzeug>=0.14

Reading https://pypi.org/simple/Werkzeug/

Downloading https://files.pythonhosted.org/packages/20/c4/12e3e56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3-none-any.whl#sha256=d5da73735293558eb1651ee2fddc4d0dedcfa06538b8813a2e20011583c9e49b

Best match: Werkzeug 0.14.1

Processing Werkzeug-0.14.1-py2.py3-none-any.whl

Installing Werkzeug-0.14.1-py2.py3-none-any.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

writing requirements to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/Werkzeug-0.14.1-py3.7.egg/EGG-INFO/requires.txt

Adding Werkzeug 0.14.1 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/Werkzeug-0.14.1-py3.7.egg

Searching for MarkupSafe>=0.23

Reading https://pypi.org/simple/MarkupSafe/

Downloading https://files.pythonhosted.org/packages/96/52/eef455862764cb6d6c136aa52c7f9fc4e7c1c644790a7107b1244a2b8a53/MarkupSafe-1.1.0-cp37-cp37m-macosx_10_6_intel.whl#sha256=1f19ef5d3908110e1e891deefb5586aae1b49a7440db952454b4e281b41620cd

Best match: MarkupSafe 1.1.0

Processing MarkupSafe-1.1.0-cp37-cp37m-macosx_10_6_intel.whl

Installing MarkupSafe-1.1.0-cp37-cp37m-macosx_10_6_intel.whl to /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages

Adding MarkupSafe 1.1.0 to easy-install.pth file

Installed /Users/ajain/miniconda3/envs/fws_test_env/lib/python3.7/site-packages/MarkupSafe-1.1.0-py3.7-macosx-10.7-x86_64.egg

Finished processing dependencies for FireWorks==1.8.4

(fws_test_env) computron-7:fireworks ajain$ cd …

(fws_test_env) computron-7:test_fws ajain$ python test_wf.py

2019-01-24 00:37:32,313 INFO Performing db tune-up

2019-01-24 00:37:32,320 INFO LaunchPad was RESET.

2019-01-24 00:37:32,322 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}

2019-01-24 00:37:32,501 INFO Created new dir /Users/ajain/test_fws/launcher_2019-01-24-08-37-32-501749

2019-01-24 00:37:32,502 INFO Launching Rocket

2019-01-24 00:37:32,732 INFO RUNNING fw_id: 3 in directory: /Users/ajain/test_fws/launcher_2019-01-24-08-37-32-501749

2019-01-24 00:37:32,740 INFO Task started: ScriptTask.

hello

2019-01-24 00:37:32,748 INFO Task completed: ScriptTask

Traceback (most recent call last):

File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf

updated_ids = wf.refresh(fw_id)

File “fireworks/fireworks/core/firework.py”, line 1011, in refresh

updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))

File “fireworks/fireworks/core/firework.py”, line 974, in refresh

if fw.spec.get(’_allow_fizzled_parents’):

File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec

return self.partial_fw.spec

File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw

self._fw = Firework.from_dict(data)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load

return load_object(obj)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object

raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))

ValueError: load_object() could not find a class with cls._fw_name PyTask

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “fireworks/fireworks/core/rocket.py”, line 357, in run

lp.complete_launch(launch_id, m_action, final_state)

File “fireworks/fireworks/core/launchpad.py”, line 1278, in complete_launch

self._refresh_wf(fw_id)

File “fireworks/fireworks/core/launchpad.py”, line 1482, in _refresh_wf

raise RuntimeError(err_message)

RuntimeError: Error refreshing workflow. The full stack trace is: Traceback (most recent call last):

File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf

updated_ids = wf.refresh(fw_id)

File “fireworks/fireworks/core/firework.py”, line 1011, in refresh

updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))

File “fireworks/fireworks/core/firework.py”, line 974, in refresh

if fw.spec.get(’_allow_fizzled_parents’):

File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec

return self.partial_fw.spec

File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw

self._fw = Firework.from_dict(data)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load

return load_object(obj)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object

raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))

ValueError: load_object() could not find a class with cls._fw_name PyTask

Traceback (most recent call last):

File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf

File “fireworks/fireworks/core/firework.py”, line 1011, in refresh

File “fireworks/fireworks/core/firework.py”, line 974, in refresh

File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec

File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in

File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load

File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object

ValueError: load_object() could not find a class with cls._fw_name PyTask

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “fireworks/fireworks/core/rocket.py”, line 357, in run

File “fireworks/fireworks/core/launchpad.py”, line 1278, in complete_launch

File “fireworks/fireworks/core/launchpad.py”, line 1482, in _refresh_wf

RuntimeError: Error refreshing workflow. The full stack trace is: Traceback (most recent call last):

File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf

updated_ids = wf.refresh(fw_id)

File “fireworks/fireworks/core/firework.py”, line 1011, in refresh

updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))

File “fireworks/fireworks/core/firework.py”, line 974, in refresh

if fw.spec.get(’_allow_fizzled_parents’):

File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec

return self.partial_fw.spec

File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw

self._fw = Firework.from_dict(data)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load

return load_object(obj)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object

raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))

ValueError: load_object() could not find a class with cls._fw_name PyTask

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “fireworks/fireworks/core/launchpad.py”, line 1468, in _refresh_wf

File “fireworks/fireworks/core/launchpad.py”, line 1508, in _update_wf

File “fireworks/fireworks/core/firework.py”, line 1080, in to_db_dict

File “fireworks/fireworks/core/firework.py”, line 779, in state

File “fireworks/fireworks/core/firework.py”, line 779, in

File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec

File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in

File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load

File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object

ValueError: load_object() could not find a class with cls._fw_name PyTask

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “test_wf.py”, line 18, in

rapidfire(launchpad)

File “fireworks/fireworks/core/rocket_launcher.py”, line 108, in rapidfire

File “fireworks/fireworks/core/rocket_launcher.py”, line 58, in launch_rocket

File “fireworks/fireworks/core/rocket.py”, line 402, in run

File “fireworks/fireworks/core/launchpad.py”, line 1278, in complete_launch

File “fireworks/fireworks/core/launchpad.py”, line 1482, in _refresh_wf

RuntimeError: Error refreshing workflow. The full stack trace is: Traceback (most recent call last):

File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf

updated_ids = wf.refresh(fw_id)

File “fireworks/fireworks/core/firework.py”, line 1011, in refresh

updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))

File “fireworks/fireworks/core/firework.py”, line 974, in refresh

if fw.spec.get(’_allow_fizzled_parents’):

File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec

return self.partial_fw.spec

File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw

self._fw = Firework.from_dict(data)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load

return load_object(obj)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object

raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))

ValueError: load_object() could not find a class with cls._fw_name PyTask

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “fireworks/fireworks/core/rocket.py”, line 357, in run

lp.complete_launch(launch_id, m_action, final_state)

File “fireworks/fireworks/core/launchpad.py”, line 1278, in complete_launch

self._refresh_wf(fw_id)

File “fireworks/fireworks/core/launchpad.py”, line 1482, in _refresh_wf

raise RuntimeError(err_message)

RuntimeError: Error refreshing workflow. The full stack trace is: Traceback (most recent call last):

File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf

updated_ids = wf.refresh(fw_id)

File “fireworks/fireworks/core/firework.py”, line 1011, in refresh

updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))

File “fireworks/fireworks/core/firework.py”, line 974, in refresh

if fw.spec.get(’_allow_fizzled_parents’):

File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec

return self.partial_fw.spec

File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw

self._fw = Firework.from_dict(data)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load

return load_object(obj)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object

raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))

ValueError: load_object() could not find a class with cls._fw_name PyTask

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “fireworks/fireworks/core/launchpad.py”, line 1468, in _refresh_wf

self._update_wf(wf, updated_ids)

File “fireworks/fireworks/core/launchpad.py”, line 1508, in _update_wf

wf = wf.to_db_dict()

File “fireworks/fireworks/core/firework.py”, line 1080, in to_db_dict

m_dict[‘state’] = self.state

File “fireworks/fireworks/core/firework.py”, line 779, in state

for child_id in self.links[fizzled_id])):

File “fireworks/fireworks/core/firework.py”, line 779, in

for child_id in self.links[fizzled_id])):

File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec

return self.partial_fw.spec

File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw

self._fw = Firework.from_dict(data)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in

new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in

return {k: _recursive_load(v) for k, v in obj.items()}

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in

return [_recursive_load(v) for v in obj]

File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load

return load_object(obj)

File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object

raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))

ValueError: load_object() could not find a class with cls._fw_name PyTask

(fws_test_env) computron-7:test_fws ajain$ vi test_wf.py # remove the first two lines of the script

(fws_test_env) computron-7:test_fws ajain$ python test_wf.py

2019-01-24 00:39:41,917 INFO Performing db tune-up

2019-01-24 00:39:41,923 INFO LaunchPad was RESET.

2019-01-24 00:39:41,925 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}

2019-01-24 00:39:42,007 INFO Created new dir /Users/ajain/test_fws/launcher_2019-01-24-08-39-42-006876

2019-01-24 00:39:42,007 INFO Launching Rocket

2019-01-24 00:39:42,019 INFO RUNNING fw_id: 3 in directory: /Users/ajain/test_fws/launcher_2019-01-24-08-39-42-006876

2019-01-24 00:39:42,024 INFO Task started: ScriptTask.

hello

2019-01-24 00:39:42,028 INFO Task completed: ScriptTask

2019-01-24 00:39:42,049 INFO Rocket finished

2019-01-24 00:39:42,052 INFO Created new dir /Users/ajain/test_fws/launcher_2019-01-24-08-39-42-052138

2019-01-24 00:39:42,052 INFO Launching Rocket

2019-01-24 00:39:42,061 INFO RUNNING fw_id: 1 in directory: /Users/ajain/test_fws/launcher_2019-01-24-08-39-42-052138

2019-01-24 00:39:42,066 INFO Task started: PyTask.

2019-01-24 00:39:47,068 INFO Task completed: PyTask

2019-01-24 00:39:47,080 INFO Rocket finished

2019-01-24 00:39:47,083 INFO Created new dir /Users/ajain/test_fws/launcher_2019-01-24-08-39-47-082953

2019-01-24 00:39:47,083 INFO Launching Rocket

2019-01-24 00:39:47,092 INFO RUNNING fw_id: 2 in directory: /Users/ajain/test_fws/launcher_2019-01-24-08-39-47-082953

2019-01-24 00:39:47,096 INFO Task started: ScriptTask.

goodbye

2019-01-24 00:39:47,100 INFO Task completed: ScriptTask

2019-01-24 00:39:47,111 INFO Rocket finished

============

On Thu, Jan 24, 2019 at 12:23 AM Leip [email protected] wrote:

I used python setup.py develop

The test seems ok (ran 156 tests, OK (skipped=8)

Le mercredi 23 janvier 2019 10:57:22 UTC+1, Leip a écrit :

Hi,

I’d like to use PyTask to execute custom functions.

Using the very simple Workflow from the doc, I have this:

~/working$ ls
fireworks test-wf.py

~/working$ cat test-wf.py
import sys
sys.path.insert(0, “fireworks”)
from fireworks import Firework, Workflow, LaunchPad, ScriptTask, PyTask
from fireworks.core.rocket_launcher import rapidfire

set up the LaunchPad and reset it

launchpad = LaunchPad()
launchpad.reset(’’, require_password=False)

create the individual FireWorks and Workflow

fw1 = Firework(ScriptTask.from_str(‘echo hello’), name=“hello”)
fw2 = Firework(ScriptTask.from_str(‘echo goodbye’), name=“goodbye”)
fw_timer = Firework(PyTask(func=‘time.sleep’,args=[5]))
wf = Workflow([fw1, fw2, fw_timer], {fw1:fw_timer, fw_timer: fw2}, name=“test workflow”)

store workflow and launch it locally

launchpad.add_wf(wf)
rapidfire(launchpad)

~/working$ python3 test-wf.py
2019-01-23 10:53:15,208 INFO Performing db tune-up
2019-01-23 10:53:15,215 INFO LaunchPad was RESET.
2019-01-23 10:53:15,218 INFO Added a workflow. id_map: {-3: 1, -2: 2, -1: 3}
2019-01-23 10:53:15,287 INFO Created new dir /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,287 INFO Launching Rocket
2019-01-23 10:53:15,299 INFO RUNNING fw_id: 3 in directory: /home/leid/working/launcher_2019-01-23-09-53-15-287161
2019-01-23 10:53:15,308 INFO Task started: ScriptTask.
hello
2019-01-23 10:53:15,314 INFO Task completed: ScriptTask
Traceback (most recent call last):
File “fireworks/fireworks/core/launchpad.py”, line 1467, in _refresh_wf
updated_ids = wf.refresh(fw_id)
File “fireworks/fireworks/core/firework.py”, line 1011, in refresh
updated_ids = updated_ids.union(self.refresh(child_id, updated_ids))
File “fireworks/fireworks/core/firework.py”, line 974, in refresh
if fw.spec.get(’_allow_fizzled_parents’):
File “fireworks/fireworks/core/launchpad.py”, line 1790, in spec
return self.partial_fw.spec
File “fireworks/fireworks/core/launchpad.py”, line 1863, in partial_fw
self._fw = Firework.from_dict(data)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in _decorator
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 155, in
new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in _recursive_load
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 118, in
return {k: _recursive_load(v) for k, v in obj.items()}
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in _recursive_load
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 121, in
return [_recursive_load(v) for v in obj]
File “fireworks/fireworks/utilities/fw_serializers.py”, line 113, in _recursive_load
return load_object(obj)
File “fireworks/fireworks/utilities/fw_serializers.py”, line 369, in load_object
raise ValueError(‘load_object() could not find a class with cls._fw_name {}’.format(fw_name))
ValueError: load_object() could not find a class with cls._fw_name PyTask

I also tried others imports:

from fireworks.user_objects.firetasks.script_task import PyTask

or:

import fireworks.user_objects.firetasks.script_task

How should I do?

(And why is the documentation so unclear?)

You received this message because you are subscribed to the Google Groups “fireworkflows” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

Visit this group at https://groups.google.com/group/fireworkflows.

For more options, visit https://groups.google.com/d/optout.


Best,
Anubhav