Skip to content

Commit a1d6e4b

Browse files
committed
Cleaan up quantum_espresso_workflow.py
1 parent 9c05728 commit a1d6e4b

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

quantum_espresso_workflow.py

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,20 @@
1212
def write_input(input_dict, working_directory="."):
1313
filename = os.path.join(working_directory, "input.pwi")
1414
os.makedirs(working_directory, exist_ok=True)
15-
try:
16-
write(
17-
filename=filename,
18-
images=Atoms(**input_dict["structure"]),
19-
Crystal=True,
20-
kpts=input_dict["kpts"],
21-
input_data={
22-
"calculation": input_dict["calculation"],
23-
"occupations": "smearing",
24-
"degauss": input_dict["smearing"],
25-
},
26-
pseudopotentials=input_dict["pseudopotentials"],
27-
tstress=True,
28-
tprnfor=True,
29-
)
30-
except KeyError:
31-
print('INPUT_DICT')
32-
print(input_dict)
15+
write(
16+
filename=filename,
17+
images=Atoms(**input_dict["structure"]),
18+
Crystal=True,
19+
kpts=input_dict["kpts"],
20+
input_data={
21+
"calculation": input_dict["calculation"],
22+
"occupations": "smearing",
23+
"degauss": input_dict["smearing"],
24+
},
25+
pseudopotentials=input_dict["pseudopotentials"],
26+
tstress=True,
27+
tprnfor=True,
28+
)
3329

3430

3531
def collect_output(working_directory="."):
@@ -65,14 +61,6 @@ def generate_structures(structure, strain_lst):
6561
return {f"s_{i}": atoms_to_json_dict(atoms=s) for i, s in enumerate(structure_lst)}
6662

6763

68-
def scale_structure(structure, strain):
69-
structure_strain = Atoms(**structure)
70-
structure_strain.set_cell(
71-
structure_strain.cell * strain ** (1 / 3), scale_atoms=True
72-
)
73-
return structure_strain
74-
75-
7664
def plot_energy_volume_curve(volume_lst, energy_lst):
7765
plt.plot(volume_lst, energy_lst)
7866
plt.xlabel("Volume")

0 commit comments

Comments
 (0)