Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanSchmidt1 committed Jan 18, 2024
1 parent a671f14 commit 0cf5df0
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tests/vasp/test_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def test_user_incar_settings():
"NSW": 5_000,
"PREC": 10, # wrong type, should be string.
"SIGMA": 20,
"LDAUU": {"H": 5.},
"LDAUJ": {"H": 6.},
"LDAUL": {"H": 3.},
"LDAUU": {"H": 5.0},
"LDAUJ": {"H": 6.0},
"LDAUL": {"H": 3.0},
"LDAUTYPE": 2,
}

Expand All @@ -87,9 +87,7 @@ def test_user_incar_settings():
if isinstance(incar[key], str):
assert incar[key].lower() == uis[key].lower()
elif isinstance(uis[key], dict):
assert incar[key] == [
uis[key][str(site.specie)] for site in structure
]
assert incar[key] == [uis[key][str(site.specie)] for site in structure]
else:
assert incar[key] == uis[key]

Expand All @@ -100,9 +98,9 @@ def test_user_incar_settings():
("struct_no_magmoms", {}),
("struct_with_magmoms", {}),
("struct_with_spin", {}),
("struct_no_magmoms", {"MAGMOM": {"Fe": 3.7,"O": 0.8}}),
("struct_with_magmoms", {"MAGMOM": {"Fe": 3.7,"O": 0.8}}),
("struct_with_spin", {"MAGMOM": {"Fe2+,spin=4": 3.7,"O2-,spin=0.63": 0.8}}),
("struct_no_magmoms", {"MAGMOM": {"Fe": 3.7, "O": 0.8}}),
("struct_with_magmoms", {"MAGMOM": {"Fe": 3.7, "O": 0.8}}),
("struct_with_spin", {"MAGMOM": {"Fe2+,spin=4": 3.7, "O2-,spin=0.63": 0.8}}),
],
)
def test_incar_magmoms_precedence(structure, user_incar_settings, request) -> None:
Expand Down Expand Up @@ -130,8 +128,7 @@ def test_incar_magmoms_precedence(structure, user_incar_settings, request) -> No

if user_incar_settings: # case 1
assert incar_magmom == [
user_incar_settings["MAGMOM"][str(site.specie)]
for site in structure
user_incar_settings["MAGMOM"][str(site.specie)] for site in structure
]
elif has_struct_magmom: # case 2
assert incar_magmom == structure.site_properties["magmom"]
Expand Down

0 comments on commit 0cf5df0

Please sign in to comment.