Created
November 9, 2014 06:09
-
-
Save computron/051eeb8c75e3e0c5b7d0 to your computer and use it in GitHub Desktop.
basic demo of using the fireworks-vasp codebase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fireworks import Firework | |
from fireworks.core.firework import Workflow | |
from fireworks_vasp.tasks import WriteVaspInputTask, VaspCustodianTask, VaspAnalyzeTask | |
from pymatgen.matproj.rest import MPRester | |
""" | |
This demo shows how one can use the fireworks-vasp codebase. It runs only a single VASP job. | |
To run multiple VASP jobs in a workflow, one needs to pass the directory information between | |
jobs such that input files can be copied. | |
""" | |
def get_wf_from_structure(structure, viset='MPVaspInputSet', params={}, handlers="all", vasp_cmd="vasp"): | |
name = structure.formula | |
wf_name = name | |
t1 = WriteVaspInputTask(structure=structure, vasp_input_set=viset, input_set_params=params) | |
t2 = VaspCustodianTask(vasp_cmd=vasp_cmd, handlers=handlers) | |
t3 = VaspAnalyzeTask() | |
return Workflow.from_FireWork(Firework([t1, t2, t3], name=name), name=wf_name) | |
if __name__ == '__main__': | |
structure = MPRester().get_structures('mp-19017')[0] | |
wf = get_wf_from_structure(structure) | |
print wf.to_format('json') |
how can i install these please:
from fireworks.core.firework import Workflow from fireworks_vasp.tasks import WriteVaspInputTask, VaspCustodianTask, VaspAnalyzeTask from pymatgen.matproj.rest import MPRester
thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @computron
This demo version seems to use a deprecated version of fireworks. Certain fixes required with the newer version of Fireworks.
Especially, Workflow.from_FireWork
Thanks