Skip to content

Commit

Permalink
ruff enable PIE (flake8-pie)
Browse files Browse the repository at this point in the history
fix 3 PIE804 Unnecessary `dict` kwargs
  • Loading branch information
janosh committed May 6, 2023
1 parent 359fed2 commit 490fbc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pymatgen/io/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ def get_atoms(structure, **kwargs):
charges = structure.site_properties["final_charge"] if "final_charge" in structure.site_properties else None
if magmoms or charges:
if magmoms and charges:
calc = SinglePointDFTCalculator(atoms, **{"magmoms": magmoms, "charges": charges})
calc = SinglePointDFTCalculator(atoms, magmoms=magmoms, charges=charges)
elif magmoms:
calc = SinglePointDFTCalculator(atoms, **{"magmoms": magmoms})
calc = SinglePointDFTCalculator(atoms, magmoms=magmoms)
elif charges:
calc = SinglePointDFTCalculator(atoms, **{"charges": charges})
calc = SinglePointDFTCalculator(atoms, charges=charges)
atoms.calc = calc

# Get the oxidation states from the structure
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"PIE", # flake8-pie
"PLE", # pylint error
"PLW", # pylint warning
"Q", # flake8-quotes
Expand Down

0 comments on commit 490fbc5

Please sign in to comment.