Error in using Launchpad get_fw_by_id

51 views
Skip to first unread message

Janakiraman Balachandran

unread,
Oct 11, 2016, 6:45:11 PM10/11/16
to fireworkflows
Hi,

 I'm trying to use firework in python to read through my mongodb. However, when I invoke `launchpad.get_fw_by_id`, I get the following error. Its got to do with compatibility with pymatgen (which renamed io.vaspio module to io.vasp). However I could not identify which file this is getting set and it will be of great help if you can help me address it. I'm using the latest stable versions of fireworks, pymatgen and monty as available in pip.

File "testCode.py", line 138, in <module>
    structureDictKeyList)
  File "calcCrystalStrucDistort.py", line 37, in get_fw_info
    firework = launchpad.get_fw_by_id(fw_id)
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/core/launchpad.py", line 355, in get_fw_by_id
    return Firework.from_dict(self.get_fw_dict_by_id(fw_id))
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 151, in _decorator
    new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 151, in <dictcomp>
    new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 117, in _recursive_load
    return [_recursive_load(v) for v in obj]
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in _recursive_load
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in <dictcomp>
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in _recursive_load
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in <dictcomp>
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in _recursive_load
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in <dictcomp>
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in _recursive_load
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in <dictcomp>
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in _recursive_load
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 114, in <dictcomp>
    return {k: _recursive_load(v) for k, v in obj.items()}
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/fireworks/utilities/fw_serializers.py", line 112, in _recursive_load
    return json.loads(json.dumps(obj), cls=MontyDecoder)
  File "/usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 352, in loads
    return cls(encoding=encoding, **kw).decode(s)
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/monty/json.py", line 224, in decode
    return self.process_decoded(d)
  File "/Users/kw1/.pythonvirtualenvs/pymatgenPython2_Oct2016/lib/python2.7/site-packages/monty/json.py", line 200, in process_decoded
    mod = __import__(modname, globals(), locals(), [classname], 0)
ImportError: No module named vaspio.vasp_input

Janakiraman Balachandran

unread,
Oct 12, 2016, 4:35:17 PM10/12/16
to fireworkflows
Hi Any updates on this issue?

Joseph Montoya

unread,
Oct 12, 2016, 5:04:55 PM10/12/16
to Janakiraman Balachandran, fireworkflows
It looks like you have a serialized object in your firework spec that can no longer be reconstructed via recursive_load, since the code from which it was constructed (in this case, pymatgen) has changed.  You can either update the spec of the existing fireworks such that deprecated objects are replaced with current ones, or you can revert to a prior version of the code used to generate that object such that the module that was changed (in this case pymatgen.io.vaspio) is concurrent with the serialized object.

Best,
Joey

--
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 fireworkflow...@googlegroups.com.
To post to this group, send email to firewo...@googlegroups.com.
Visit this group at https://groups.google.com/group/fireworkflows.
To view this discussion on the web visit https://groups.google.com/d/msgid/fireworkflows/6c3db589-505b-4507-a95d-227020ce2e6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anubhav Jain

unread,
Oct 12, 2016, 6:31:06 PM10/12/16
to Joseph Montoya, Janakiraman Balachandran, fireworkflows
There is another (probably preferred option) of using the FW_NAME_UPDATES key in the FWConfig to update the _fw_name of the refactored files. The format of that is a dictionary; each key is the old _fw_name, and the corresponding value should be the new _fw_name



Best,
Joey

To unsubscribe from this group and stop receiving emails from it, send an email to fireworkflows+unsubscribe@googlegroups.com.

--
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 fireworkflows+unsubscribe@googlegroups.com.

To post to this group, send email to firewo...@googlegroups.com.
Visit this group at https://groups.google.com/group/fireworkflows.

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



--
Best,
Anubhav

Janakiraman Balachandran

unread,
Oct 18, 2016, 1:28:19 PM10/18/16
to fireworkflows, mont...@lbl.gov, jan...@umich.edu
I have not done this before and I have not made any changes myself. I have only installed the packages from pip. Can you tell me the pymatgen version that was used to serialize the latest version available in pip and I can install that version of pymatgen in my system.

Best,
Joey

To unsubscribe from this group and stop receiving emails from it, send an email to fireworkflow...@googlegroups.com.

--
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 fireworkflow...@googlegroups.com.

To post to this group, send email to firewo...@googlegroups.com.
Visit this group at https://groups.google.com/group/fireworkflows.



--
Best,
Anubhav

Janakiraman Balachandran

unread,
Oct 19, 2016, 10:31:03 AM10/19/16
to fireworkflows, mont...@lbl.gov, jan...@umich.edu
Gosh. I now understand. I was using a deprecated fireworks_vasp module to create the database and which in turn used the vaspio module of pymatgen which has since been deprecated. The problem was that information was missing from the error message. I created the vaspio module manually inside pymatgen.io and it now works. Although I still dont understand anubhavs answer. Say if I create a new updated package say fireworks_vasp2 that provides that is compatible with pymatgen. How do I provide this information in FW_Config. I have three firetasks bundled in each firework and they have different classes as ` _fw_name `

firewoks_vasp.tasks.WriteVaspInputTask, firewoks_vasp.tasks.VaspCustodianTask and firewoks_vasp.tasks.VaspAnalyzeTask.

How do I use the FW_NAME_UPDATES  so that it can systematically change the names of the three firetasks?

Anubhav Jain

unread,
Oct 19, 2016, 12:07:15 PM10/19/16
to Janakiraman Balachandran, fireworkflows, Joseph Montoya
To set up the config file:


Add something like

FW_NAME_UPDATES: {<old_name>: <new_name>}

To unsubscribe from this group and stop receiving emails from it, send an email to fireworkflows+unsubscribe@googlegroups.com.

To post to this group, send email to firewo...@googlegroups.com.
Visit this group at https://groups.google.com/group/fireworkflows.

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



--
Best,
Anubhav

Janakiraman Balachandran

unread,
Oct 19, 2016, 2:19:36 PM10/19/16
to fireworkflows, jan...@umich.edu, mont...@lbl.gov
Thanks. I knew to setup config file. I just did not know the syntax for FW_NAME_UPDATES. I will give that a try. Thanks



--
Best,
Anubhav
Reply all
Reply to author
Forward
0 new messages