Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiCheng45 committed Feb 14, 2025
1 parent 473aa1a commit 67b48bc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions MDANSE/Tests/UnitTests/Analysis/test_mock_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ def test_vacf(interp_order, normalise):

with h5py.File(temp_name + ".mda") as actual, h5py.File(result_file) as desired:
for key in ["vacf_H", "vacf_O", "vacf_Si", "vacf_total"]:
# reference results were not rescaled
np.testing.assert_array_almost_equal(
actual[f"/{key}"], desired[f"/{key}"],
)
if normalise:
np.testing.assert_array_almost_equal(
actual[f"/{key}"] * actual[f"/{key}"].attrs["scaling_factor"],
desired[f"/{key}"],
)
else:
np.testing.assert_array_almost_equal(
actual[f"/{key}"], desired[f"/{key}"],
)

os.remove(temp_name + ".mda")
assert path.exists(temp_name + ".log")
Expand Down

0 comments on commit 67b48bc

Please sign in to comment.