Skip to content

Commit

Permalink
replace dunder __getattribute__ --> getattr in forcefield test_md
Browse files Browse the repository at this point in the history
  • Loading branch information
esoteric-ephemera committed Apr 2, 2024
1 parent 0a06373 commit 4a88d7b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/forcefields/test_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ def test_nve_and_dynamics_obj(si_structure: Structure, test_dir: Path):
# ensure that output is consistent if molecular dynamics object is specified
# as str or as MolecularDynamics object
for attr in ("energy", "forces", "stress", "structure"):
vals = {
k: output[k].output.__getattribute__(attr) for k in ("from_str", "from_dyn")
}
vals = {k: getattr(output[k].output, attr) for k in ("from_str", "from_dyn")}
if isinstance(vals["from_str"], float):
assert vals["from_str"] == pytest.approx(vals["from_dyn"])
elif isinstance(vals["from_str"], Structure):
Expand Down

0 comments on commit 4a88d7b

Please sign in to comment.