Skip to content

Commit

Permalink
tweak relative tolerance of two failing unit tests for multithreading…
Browse files Browse the repository at this point in the history
… and single precision (#1742)
  • Loading branch information
oskooi authored Aug 26, 2021
1 parent 74cb6dd commit cdae1a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion python/tests/test_force.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def test_force(self):
f = mp.get_forces(self.myforce)

self.assertAlmostEqual(f[0], -0.11039089113393187)
self.assertAlmostEqual(f[0], mp.get_forces(self.myforce_decimated)[0])

places = 6 if mp.is_single_precision() else 7
self.assertAlmostEqual(f[0], mp.get_forces(self.myforce_decimated)[0], places=places)


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_holey_wvg_bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_fields_at_kx(self):
]

self.assertTrue(h.modes)
places = 5 if mp.is_single_precision() else 7
places = 4 if mp.is_single_precision() else 7
for (r, i), m in zip(expected, h.modes):
self.assertAlmostEqual(m.freq, r, places=places)
self.assertAlmostEqual(m.decay, i, places=places)
Expand Down

0 comments on commit cdae1a8

Please sign in to comment.