Skip to content

Commit 4550e49

Browse files
authored
Merge branch 'hackingmaterials:main' into main
2 parents ed2114e + 95c489b commit 4550e49

File tree

15 files changed

+47
-51
lines changed

15 files changed

+47
-51
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@ default_install_hook_types: [pre-commit, commit-msg]
99
exclude: ^(docs/|.*test_files/|.*tests/)
1010

1111
repos:
12-
- repo: https://github.com/myint/autoflake
12+
- repo: https://github.com/PyCQA/autoflake
1313
rev: v1.4
1414
hooks:
1515
- id: autoflake
16-
args:
17-
- --in-place
18-
- --remove-unused-variables
19-
- --remove-all-unused-imports
20-
- --expand-star-imports
21-
- --ignore-init-module-imports
2216

2317
- repo: https://github.com/psf/black
2418
rev: 22.6.0
@@ -29,6 +23,7 @@ repos:
2923
rev: 5.0.4
3024
hooks:
3125
- id: flake8
26+
additional_dependencies: [flake8-bugbear]
3227

3328
- repo: https://github.com/pre-commit/mirrors-mypy
3429
rev: v0.971

atomate/qchem/drones.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ def generate_doc(self, dir_name, qcinput_files, qcoutput_files, multirun):
232232
]
233233
if d["output"]["job_type"] in ["freq", "frequency"]:
234234
d["output"]["frequencies"] = d_calc_final["frequencies"]
235-
d["output"]["frequency_modes"] = d_calc_final["frequency_mode_vectors"]
235+
# Note: for single-atom freq calcs, this key may not exist
236+
d["output"]["frequency_modes"] = d_calc_final.get("frequency_mode_vectors", [])
236237
d["output"]["enthalpy"] = d_calc_final["total_enthalpy"]
237238
d["output"]["entropy"] = d_calc_final["total_entropy"]
238239
if d["input"]["job_type"] in ["opt", "optimization", "ts"]:
@@ -507,7 +508,7 @@ def validate_doc(self, d):
507508
to pass validation is unfortunately unlikely to be noticed by a user.
508509
"""
509510
for k, v in self.schema.items():
510-
diff = v.difference(set(d.get(k, d).keys()))
511+
diff = v - set(d.get(k, d).keys())
511512
if diff:
512513
logger.warning(f"The keys {diff} in {k} not set")
513514

atomate/utils/database.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(
3535
**kwargs,
3636
):
3737
"""
38-
Obeject to handle storing calculation data to MongoDB databases.
38+
Object to handle storing calculation data to MongoDB databases.
3939
The results of calculations will be parsed by a Drone and
4040
CalcDb is only responsible for putting that data into the database
4141
@@ -50,7 +50,7 @@ def __init__(
5050
other authentication information will be ignored
5151
maggma_store_kwargs: additional kwargs for mongodb login.
5252
Currently supports:
53-
S3 store kwarges:
53+
S3 store kwargs:
5454
"bucket" : the S3 bucket where the data is stored
5555
"s3_profile" : the S3 profile that contains the login information
5656
typically found at ~/.aws/credentials
@@ -255,7 +255,7 @@ def _get_s3_store(self, store_name):
255255
and the store_name will double as the sub_dir name.
256256
257257
Args:
258-
store_name: correspond to the the key within calcs_reversed.0 that will be stored
258+
store_name: correspond to the key within calcs_reversed.0 that will be stored
259259
"""
260260
if self.host_uri is not None:
261261
index_store_ = MongoURIStore(

atomate/vasp/drones.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,9 @@ def validate_doc(self, d):
828828
# notice if the validation fails? -computron
829829
for k, v in self.schema.items():
830830
if k == "calcs_reversed":
831-
diff = v.difference(set(d.get(k, d)[0].keys()))
831+
diff = v - set(d.get(k, d)[0].keys())
832832
else:
833-
diff = v.difference(set(d.get(k, d).keys()))
833+
diff = v - set(d.get(k, d).keys())
834834
if diff:
835835
logger.warning(f"The keys {diff} in {k} not set")
836836

atomate/vasp/firetasks/electrode_tasks.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,7 @@
1010
from atomate.vasp.database import VaspCalcDb
1111
from atomate.vasp.firetasks import pass_vasp_result
1212
from atomate.vasp.fireworks.core import OptimizeFW, StaticFW
13-
14-
try:
15-
from pymatgen.analysis.defects import ChargeInsertionAnalyzer
16-
except ImportError:
17-
print(
18-
"Failed to import ChargeInsertionAnalyzer. This is likely due to converting the pymatgen defects module "
19-
"to a namespace package. See https://github.com/materialsproject/pymatgen/pull/2582#issuecomment-1198318101 "
20-
"for updates."
21-
)
13+
from pymatgen.analysis.defects.utils import ChargeInsertionAnalyzer
2214

2315
__author__ = "Jimmy Shen"
2416
__email__ = "[email protected]"

atomate/vasp/firetasks/write_inputs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ def run_task(self, fw_spec):
630630
t_cls = None
631631
for m in [
632632
"advanced_transformations",
633-
"defect_transformations",
634633
"site_transformations",
635634
"standard_transformations",
636635
]:
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Si2
22
1.0
3-
3.840198 0.000000 0.000000
4-
1.920099 3.325710 0.000000
5-
0.000000 -2.217138 3.135509
3+
3.8401979336999998 0.0000000000000000 0.0000000000000000
4+
1.9200989667999999 3.3257101909000002 0.0000000000000000
5+
0.0000000000000000 -2.2171384942999999 3.1355090603000000
66
Si
77
2
88
direct
9-
0.000000 0.000000 0.000000 Si
10-
0.750000 0.500000 0.750000 Si
9+
0.0000000000000000 0.0000000000000000 0.0000000000000000 Si
10+
0.7500000000000000 0.5000000000000000 0.7500000000000000 Si

atomate/vasp/tests/test_setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from turtle import pos
23
import unittest
34

45
from pymatgen.core import IStructure, Lattice

atomate/vasp/workflows/base/adsorption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_slab_fw(
3030
add_slab_metadata=True,
3131
):
3232
"""
33-
Function to generate a a slab firework. Returns a TransmuterFW if
33+
Function to generate a slab firework. Returns a TransmuterFW if
3434
bulk_structure is specified, constructing the necessary transformations
3535
from the slab and slab generator parameters, or an OptimizeFW if only a
3636
slab is specified.

atomate/vasp/workflows/base/neb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def get_wf_neb_from_structure(
8383
user_incar_settings is used to determine how many NEB rounds will be. Default
8484
is [{}, {}, {}].
8585
additional_spec (dict): User spec settings to overwrite default_spec.
86-
user_kpoints_settings ([dict]): Additional user_kpoints_settings, which contains at at
86+
user_kpoints_settings ([dict]): Additional user_kpoints_settings, which contains at
8787
least three elements, which is similar to user_incar_settings. For example,
8888
[{}, {}, {"grid_density": 100}] for the workflow from the parent structure
8989
relaxation, then the endpoint relaxation followed by one-round NEB simulation.
@@ -170,7 +170,7 @@ def get_wf_neb_from_structure(
170170
)
171171
)
172172

173-
for i, label in enumerate(["ep0", "ep1"]):
173+
for label in ["ep0", "ep1"]:
174174
fw = NEBRelaxationFW(
175175
spec=spec,
176176
label=label,
@@ -221,7 +221,7 @@ def get_wf_neb_from_endpoints(
221221
user_incar_settings is used to determine how many NEB rounds will be. Default
222222
is [{}, {}, {}].
223223
additional_spec (dict): User spec settings to overwrite default_spec.
224-
user_kpoints_settings ([dict]): Additional user_kpoints_settings, which contains at at
224+
user_kpoints_settings ([dict]): Additional user_kpoints_settings, which contains at
225225
least three elements, which is similar to user_incar_settings. For example,
226226
[{}, {}, {"grid_density": 100}] for the workflow from the parent structure
227227
relaxation, then the endpoint relaxation followed by one-round NEB simulation.
@@ -320,7 +320,7 @@ def get_wf_neb_from_images(
320320
user_incar_settings is used to determine how many NEB rounds will be. Default
321321
is [{}, {}, {}].
322322
additional_spec (dict): User spec settings to overwrite default_spec.
323-
user_kpoints_settings ([dict]): Additional user_kpoints_settings, which contains at at
323+
user_kpoints_settings ([dict]): Additional user_kpoints_settings, which contains at
324324
least three elements, which is similar to user_incar_settings. For example,
325325
[{}, {}, {"grid_density": 100}] for the workflow from the parent structure
326326
relaxation, then the endpoint relaxation followed by one-round NEB simulation.

0 commit comments

Comments
 (0)