Skip to content

Commit

Permalink
chore: Update test_SKHamiltonian to use torch.allclose with specified…
Browse files Browse the repository at this point in the history
… tolerances
  • Loading branch information
QG-phy committed Sep 24, 2024
1 parent cced890 commit c48612a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dptb/tests/test_SKHamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,6 @@ def test_onsite_stain(self):
0.0000000000e+00, 2.6077032089e-08, 0.0000000000e+00,
-3.7709136009e+00]])

assert torch.allclose(data[AtomicDataDict.NODE_FEATURES_KEY], expected_strainonsite)
assert torch.allclose(data[AtomicDataDict.NODE_FEATURES_KEY], expected_strainonsite, atol=1e-6, rtol=1e-4)


0 comments on commit c48612a

Please sign in to comment.