Skip to content

Commit 40f57cb

Browse files
authored
Merge branch 'master' into magnetism-workflow-staging
2 parents 9177007 + 246d684 commit 40f57cb

File tree

91 files changed

+5481
-985
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+5481
-985
lines changed

atomate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.8.5"
1+
__version__ = "0.8.7"

atomate/vasp/firetasks/parse_outputs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ def run_task(self, fw_spec):
10931093

10941094
polarization = Polarization(p_elecs, p_ions, structures)
10951095

1096-
p_change = polarization.get_polarization_change().A1.tolist()
1096+
p_change = np.ravel(polarization.get_polarization_change()).tolist()
10971097
p_norm = polarization.get_polarization_change_norm()
10981098
polarization_max_spline_jumps = polarization.max_spline_jumps()
10991099
same_branch = polarization.get_same_branch_polarization_data(convert_to_muC_per_cm2=True)
@@ -1108,7 +1108,7 @@ def run_task(self, fw_spec):
11081108
def split_abc(var, var_name):
11091109
d = {}
11101110
for i, j in enumerate('abc'):
1111-
d.update({var_name + "_{}".format(j): var[:, i].A1.tolist()})
1111+
d.update({var_name + "_{}".format(j): np.ravel(var[:, i]).tolist()})
11121112
return d
11131113

11141114
# Add some sort of id for the structures? Like cid but more general?

atomate/vasp/firetasks/run_calc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ def run_task(self, fw_spec):
205205
c.run()
206206

207207
if os.path.exists(zpath("custodian.json")):
208-
return FWAction(stored_data=loadfn(zpath("custodian.json")))
208+
stored_custodian_data = {"custodian": loadfn(zpath("custodian.json"))}
209+
return FWAction(stored_data=stored_custodian_data)
209210

210211

211212
@explicit_serialize

atomate/vasp/firetasks/tests/test_polarization_to_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_polarizationtodb(self):
6060
# Check recovered change in polarization
6161
coll = self.get_task_collection("polarization_tasks")
6262
d = coll.find_one()
63-
self.assertAlmostEqual(d['polarization_change_norm'], 46.288752795325244)
63+
self.assertAlmostEqual(d['polarization_change_norm'], 46.288752795325244, 5)
6464

6565

6666

atomate/vasp/firetasks/write_inputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def run_task(self, fw_spec):
314314
sym_prec=self.get("sym_prec", 0.1),
315315
international_monoclinic=self.get("international_monoclinic", True),
316316
mode=self.get("mode", "uniform"),
317-
nedos=self.get("nedos", 601),
317+
nedos=self.get("nedos", 2001),
318318
optics=self.get("optics", False),
319319
**self.get("other_params", {}))
320320
vis.write_input(".")

atomate/vasp/fireworks/core.py

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,16 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, mode="gap",
236236

237237
class NonSCFFW(Firework):
238238

239-
def __init__(self, parents=None, prev_calc_dir=None, structure=None, name="nscf", mode="uniform", vasp_cmd="vasp",
240-
copy_vasp_outputs=True, db_file=None, **kwargs):
239+
def __init__(self, parents=None, prev_calc_dir=None, structure=None,
240+
name="nscf", mode="uniform", vasp_cmd="vasp",
241+
copy_vasp_outputs=True, db_file=None,
242+
input_set_overrides=None, **kwargs):
241243
"""
242-
Standard NonSCF Calculation Firework supporting both
243-
uniform and line modes.
244+
Standard NonSCF Calculation Firework supporting uniform and line modes.
244245
245246
Args:
246-
structure (Structure): Input structure - used only to set the name of the FW.
247+
structure (Structure): Input structure - used only to set the name
248+
of the FW.
247249
name (str): Name for the Firework.
248250
mode (str): "uniform" or "line" mode.
249251
vasp_cmd (str): Command to run vasp.
@@ -253,36 +255,48 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, name="nscf"
253255
db_file (str): Path to file specifying db credentials.
254256
parents (Firework): Parents of this particular Firework.
255257
FW or list of FWS.
258+
input_set_overrides (dict): Arguments passed to the
259+
"from_prev_calc" method of the MPNonSCFSet. This parameter
260+
allows a user to modify the default values of the input set.
261+
For example, passing the key value pair
262+
{'reciprocal_density': 1000}
263+
will override default k-point meshes for uniform calculations.
256264
\*\*kwargs: Other kwargs that are passed to Firework.__init__.
257265
"""
258-
fw_name = "{}-{} {}".format(structure.composition.reduced_formula if structure else "unknown", name,
259-
mode)
266+
input_set_overrides = input_set_overrides or {}
267+
268+
fw_name = "{}-{} {}".format(structure.composition.reduced_formula if
269+
structure else "unknown", name, mode)
260270
t = []
261271

262272
if prev_calc_dir:
263-
t.append(CopyVaspOutputs(calc_dir=prev_calc_dir, additional_files=["CHGCAR"]))
273+
t.append(CopyVaspOutputs(calc_dir=prev_calc_dir,
274+
additional_files=["CHGCAR"]))
264275
elif parents:
265-
t.append(CopyVaspOutputs(calc_loc=True, additional_files=["CHGCAR"]))
276+
t.append(CopyVaspOutputs(calc_loc=True,
277+
additional_files=["CHGCAR"]))
266278
else:
267279
raise ValueError("Must specify previous calculation for NonSCFFW")
268280

269281
mode = mode.lower()
270282
if mode == "uniform":
271283
t.append(
272284
WriteVaspNSCFFromPrev(prev_calc_dir=".", mode="uniform",
273-
reciprocal_density=1000))
285+
**input_set_overrides))
274286
else:
275287
t.append(WriteVaspNSCFFromPrev(prev_calc_dir=".", mode="line",
276-
reciprocal_density=20))
288+
**input_set_overrides))
277289

278-
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd, auto_npar=">>auto_npar<<"))
290+
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd,
291+
auto_npar=">>auto_npar<<"))
279292
t.append(PassCalcLocs(name=name))
280293
t.append(VaspToDb(db_file=db_file,
281294
additional_fields={"task_label": name + " " + mode},
282295
parse_dos=(mode == "uniform"),
283296
bandstructure_mode=mode))
284297

285-
super(NonSCFFW, self).__init__(t, parents=parents, name=fw_name, **kwargs)
298+
super(NonSCFFW, self).__init__(t, parents=parents, name=fw_name,
299+
**kwargs)
286300

287301

288302
class LepsFW(Firework):
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# A typical band structure
2+
# Author: Alex Ganose ([email protected])
3+
fireworks:
4+
- fw: atomate.vasp.fireworks.core.StaticFW
5+
- fw: atomate.vasp.fireworks.core.NonSCFFW
6+
params:
7+
parents: 0
8+
mode: uniform
9+
- fw: atomate.vasp.fireworks.core.NonSCFFW
10+
params:
11+
parents: 0
12+
mode: line

atomate/vasp/workflows/presets/core.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ def wf_bandstructure(structure, c=None):
5353

5454
return wf
5555

56+
57+
def wf_bandstructure_no_opt(structure, c=None):
58+
59+
c = c or {}
60+
vasp_cmd = c.get("VASP_CMD", VASP_CMD)
61+
db_file = c.get("DB_FILE", DB_FILE)
62+
63+
wf = get_wf(structure, "bandstructure_no_opt.yaml",
64+
vis=MPStaticSet(structure, force_gamma=True),
65+
common_params={"vasp_cmd": vasp_cmd, "db_file": db_file})
66+
67+
wf = add_common_powerups(wf, c)
68+
69+
if c.get("SMALLGAP_KPOINT_MULTIPLY", SMALLGAP_KPOINT_MULTIPLY):
70+
wf = add_small_gap_multiply(wf, 0.5, 5, "static")
71+
wf = add_small_gap_multiply(wf, 0.5, 5, "nscf")
72+
73+
if c.get("ADD_WF_METADATA", ADD_WF_METADATA):
74+
wf = add_wf_metadata(wf, structure)
75+
76+
return wf
77+
78+
5679
def wf_bandstructure_hse(structure, c=None):
5780

5881
c = c or {}
524 Bytes
Loading
469 Bytes
Loading

0 commit comments

Comments
 (0)