|
5 | 5 |
|
6 | 6 | from atomate.vasp.powerups import (
|
7 | 7 | add_priority,
|
| 8 | + modify_gzip_vasp, |
8 | 9 | use_custodian,
|
9 | 10 | add_trackers,
|
10 | 11 | add_modify_incar,
|
@@ -64,21 +65,32 @@ def test_custodian_powerups(self):
|
64 | 65 | self.assertTrue("RunVaspDirect" in fw.tasks[task_idx]._fw_name)
|
65 | 66 | self.assertEqual(fw.tasks[task_idx]["vasp_cmd"], "test_VASP")
|
66 | 67 |
|
67 |
| - my_wf_double_relax = remove_custodian(copy_wf(self.bs_wf)) |
68 |
| - my_wf_double_relax = use_custodian( |
69 |
| - my_wf_double_relax, |
| 68 | + wf_double_relax = remove_custodian(copy_wf(self.bs_wf)) |
| 69 | + |
| 70 | + wf_double_relax = use_custodian( |
| 71 | + wf_double_relax, |
70 | 72 | fw_name_constraint="structure optimization",
|
71 | 73 | custodian_params={"job_type": "double_relaxation_run"},
|
72 | 74 | )
|
73 | 75 |
|
74 |
| - for fw in my_wf_double_relax.fws: |
| 76 | + for fw in wf_double_relax.fws: |
75 | 77 | if "structure optimization" in fw.name:
|
76 | 78 | self.assertTrue("RunVaspCustodian" in fw.tasks[1]._fw_name)
|
77 | 79 | self.assertEqual(fw.tasks[1]["job_type"], "double_relaxation_run")
|
78 | 80 | else:
|
79 | 81 | self.assertTrue("RunVaspDirect" in fw.tasks[2]._fw_name)
|
80 | 82 | self.assertFalse("job_type" in fw.tasks[2])
|
81 | 83 |
|
| 84 | + # test use_custodian() does not overwrite existing custodian params |
| 85 | + wf_double_relax = modify_gzip_vasp(wf_double_relax, False) |
| 86 | + wf_double_relax = use_custodian(wf_double_relax) |
| 87 | + idx_list = get_fws_and_tasks( |
| 88 | + wf_double_relax, task_name_constraint="RunVaspCustodian" |
| 89 | + ) |
| 90 | + for idx_fw, idx_t in idx_list: |
| 91 | + task = wf_double_relax.fws[idx_fw].tasks[idx_t] |
| 92 | + assert task["gzip_output"] is False |
| 93 | + |
82 | 94 | def test_modify_incar(self):
|
83 | 95 | my_wf = add_modify_incar(
|
84 | 96 | copy_wf(self.bs_wf),
|
|
0 commit comments