materialsproject / atomate2

atomate2 is a library of computational materials science workflows
https://materialsproject.github.io/atomate2/
Other
165 stars 93 forks source link

BUG: Can't run FireWorks example #14

Closed Andrew-S-Rosen closed 2 years ago

Andrew-S-Rosen commented 2 years ago

Describe the bug I ran the test code here after changing si_structure to mgo_structure (looks like a typo) with the current version of Atomate2 and FireWorks 1.9.7. I got back the following error. Any ideas where I might have gone wrong or why the error has come up? I don't know enough about FireWorks yet to be sure.

Traceback (most recent call last):
  File "test.py", line 21, in <module>
    lpad.add_wf(wf)
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/core/launchpad.py", line 427, in add_wf
    old_new = self._upsert_fws(list(wf.id_fw.values()),
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/core/launchpad.py", line 1726, in _upsert_fws
    self.fireworks.insert_many((fw.to_db_dict() for fw in fws))
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/pymongo/collection.py", line 769, in insert_many
    blk.ops = [doc for doc in gen()]
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/pymongo/collection.py", line 769, in <listcomp>
    blk.ops = [doc for doc in gen()]
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/pymongo/collection.py", line 759, in gen
    for document in documents:
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/core/launchpad.py", line 1726, in <genexpr>
    self.fireworks.insert_many((fw.to_db_dict() for fw in fws))
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/core/firework.py", line 319, in to_db_dict
    m_dict = self.to_dict()
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 146, in _decorator
    m_dict = func(self, *args, **kwargs)
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/core/firework.py", line 275, in to_dict
    spec['_tasks'] = [t.to_dict() for t in self.tasks]
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/core/firework.py", line 275, in <listcomp>
    spec['_tasks'] = [t.to_dict() for t in self.tasks]
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 175, in _decorator
    m_dict = func(self, *args, **kwargs)
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 147, in _decorator
    m_dict = recursive_dict(m_dict)
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 86, in recursive_dict
    return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode)
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 86, in <dictcomp>
    return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode)
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 80, in recursive_dict
    return recursive_dict(obj.as_dict(), preserve_unicode)
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 86, in recursive_dict
    return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode)
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 86, in <dictcomp>
    return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode)
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 90, in recursive_dict
    return [recursive_dict(v, preserve_unicode) for v in obj]
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 90, in <listcomp>
    return [recursive_dict(v, preserve_unicode) for v in obj]
  File "/global/homes/r/rosen/software/miniconda/envs/cms2/lib/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 80, in recursive_dict
    return recursive_dict(obj.as_dict(), preserve_unicode)
TypeError: as_dict() missing 1 required positional argument: 'self'
utf commented 2 years ago

Thanks for noticing this. This was an issue in the way fireworks serialised jobflow Jobs. Should be fixed by updating jobflow to version 0.1.5.