Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Update test_water_with_calc
Browse files Browse the repository at this point in the history
  • Loading branch information
phohenberger authored Jan 19, 2024
1 parent 3510941 commit 345bfb6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_znframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,13 @@ def test_to_json(ammonia):

def test_water_with_calc(waterWithCalc):
frame = Frame.from_atoms(waterWithCalc)
assert frame.to_atoms().calc == waterWithCalc.calc
duplicates = list(set(frame.calc.results.keys()) & set(frame.arrays.keys()))
if duplicates:
raise ValueError(f"Duplicate keys: {duplicates}")

atoms = frame.to_atoms()
for key in atoms.calc.results.keys():
if isinstance(atoms.calc.results[key], np.ndarray):
np.testing.assert_array_equal(atoms.calc.results[key], waterWithCalc.calc.results[key])
else:
assert atoms.calc.results[key] == waterWithCalc.calc.results[key]

0 comments on commit 345bfb6

Please sign in to comment.