I am not sure if this is a bug,
But your example is not working for PyTask
task4 = Firework(PyTask(func=‘time.sleep’,args=[5]))
set up the LaunchPad and reset it
launchpad = LaunchPad()
launchpad.reset(’’, require_password=False)
fireworker = Firework(task4)
launchpad.add_wf(fireworker)
launch_rocket(launchpad)
Traceback (most recent call last):
File “/core/apps/fw-master/fireworksMPC/testComplex.py”, line 32, in
launch_rocket(launchpad)
File “/cube/api/py-3.9.1/lib/python3.9/site-packages/fireworks/core/rocket_launcher.py”, line 58, in launch_rocket
rocket_ran = rocket.run(pdb_on_exception=pdb_on_exception)
File “/cube/api/py-3.9.1/lib/python3.9/site-packages/fireworks/core/rocket.py”, line 145, in run
m_fw, launch_id = lp.checkout_fw(self.fworker, launch_dir, self.fw_id)
File “/cube/api/py-3.9.1/lib/python3.9/site-packages/fireworks/core/launchpad.py”, line 1478, in checkout_fw
self._upsert_fws([m_fw])
File “/cube/api/py-3.9.1/lib/python3.9/site-packages/fireworks/core/launchpad.py”, line 1659, in _upsert_fws
self.fireworks.find_one_and_replace({“fw_id”: fw.fw_id}, fw.to_db_dict(), upsert=True)
File “/cube/api/py-3.9.1/lib/python3.9/site-packages/fireworks/core/firework.py”, line 363, in to_db_dict
m_dict = self.to_dict()
File “/cube/api/py-3.9.1/lib/python3.9/site-packages/fireworks/utilities/fw_serializers.py”, line 145, in _decorator
m_dict = func(self, *args, **kwargs)
File “/cube/api/py-3.9.1/lib/python3.9/site-packages/fireworks/core/firework.py”, line 317, in to_dict
spec["_tasks"] = [t.to_dict() for t in self.tasks]
File “/cube/api/py-3.9.1/lib/python3.9/site-packages/fireworks/core/firework.py”, line 317, in
spec["_tasks"] = [t.to_dict() for t in self.tasks]
AttributeError: ‘dict’ object has no attribute ‘to_dict’
Tried on 3.9.1 and 3.10.0 same results
FW version: 1.9.8
Mongo has wf, no issue there
This is part of
@recursive_serialize
def to_dict(self):
I am not sure maybe I am not doing something right here?