Skip to content

Commit

Permalink
define IRC_obj_dict key value in run_task
Browse files Browse the repository at this point in the history
  • Loading branch information
sakim8048 committed Apr 15, 2024
1 parent 80bacf6 commit babb3e0
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pynta/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,14 @@ class MolecularTSEstimate(FiretaskBase):
"name_to_adjlist_dict", "gratom_to_molecule_atom_maps",
"gratom_to_molecule_surface_atom_maps","irc_mode",
"vib_obj_dict","opt_obj_dict","nslab","Eharmtol","Eharmfiltertol","Ntsmin","max_num_hfsp_opts"]
optional_params = ["out_path","spawn_jobs","nprocs","IRC_obj_dict"]
optional_params = ["out_path","spawn_jobs","nprocs"]
def run_task(self, fw_spec):
gratom_to_molecule_atom_maps = {sm: {int(k):v for k,v in d.items()} for sm,d in self["gratom_to_molecule_atom_maps"].items()}
gratom_to_molecule_surface_atom_maps = {sm: {int(k):v for k,v in d.items()} for sm,d in self["gratom_to_molecule_surface_atom_maps"].items()}
out_path = self["out_path"] if "out_path" in self.keys() else ts_path
spawn_jobs = self["spawn_jobs"] if "spawn_jobs" in self.keys() else False
nprocs = self["nprocs"] if "nprocs" in self.keys() else 1
IRC_obj_dict = self["IRC_obj_dict"] if "IRC_obj_dict" in self.keys() else None

ts_path = self["ts_path"]
rxn = self["rxn"]
Expand Down Expand Up @@ -616,15 +617,7 @@ def run_task(self, fw_spec):

if spawn_jobs:
print(irc_mode)
if irc_mode == "skip":
ctask = MolecularCollect({"xyzs":xyzsout,"check_symm":True,"fw_generators": ["optimize_firework",["vibrations_firework"]],
"fw_generator_dicts": [self["opt_obj_dict"],[self["vib_obj_dict"]]],
"out_names": ["opt.xyz",["vib.json"]],"future_check_symms": [True,False], "label": "TS"+str(index)+"_"+rxn_name})
cfw = Firework([ctask],name="TS"+str(index)+"_"+rxn_name+"_collect",spec={"_allow_fizzled_parents": True, "_priority": 5})
newwf = Workflow([cfw],name='rxn_'+str(index)+str(rxn_name))
return FWAction(detours=newwf) #using detour allows us to inherit children from the original collect to the subsequent collects

else:
if irc_mode == "relaxed" or irc_mode == "fixed":
irc_obj_dict_forward = deepcopy(self["IRC_obj_dict"])
irc_obj_dict_forward["forward"] = True
irc_obj_dict_reverse = deepcopy(self["IRC_obj_dict"])
Expand All @@ -636,9 +629,18 @@ def run_task(self, fw_spec):
cfw = Firework([ctask],name="TS"+str(index)+"_"+rxn_name+"_collect",spec={"_allow_fizzled_parents": True, "_priority": 5})
newwf = Workflow([cfw],name='rxn_'+str(index)+str(rxn_name))
return FWAction(detours=newwf) #using detour allows us to inherit children from the original collect to the subsequent collects

#if irc_mode == "skip":
else:
ctask = MolecularCollect({"xyzs":xyzsout,"check_symm":True,"fw_generators": ["optimize_firework",["vibrations_firework"]],
"fw_generator_dicts": [self["opt_obj_dict"],[self["vib_obj_dict"]]],
"out_names": ["opt.xyz",["vib.json"]],"future_check_symms": [True,False], "label": "TS"+str(index)+"_"+rxn_name})
cfw = Firework([ctask],name="TS"+str(index)+"_"+rxn_name+"_collect",spec={"_allow_fizzled_parents": True, "_priority": 5})
newwf = Workflow([cfw],name='rxn_'+str(index)+str(rxn_name))
return FWAction(detours=newwf) #using detour allows us to inherit children from the original collect to the subsequent collects
else:
return FWAction()

def collect_firework(xyzs,check_symm,fw_generators,fw_generator_dicts,out_names,future_check_symms,parents=[],label="",allow_fizzled_parents=False):
task = MolecularCollect({"xyzs": xyzs, "check_symm": check_symm, "fw_generators": fw_generators,
"fw_generator_dicts": fw_generator_dicts, "out_names": out_names, "future_check_symms": future_check_symms, "label": label})
Expand Down

0 comments on commit babb3e0

Please sign in to comment.