Skip to content

Commit 23fdc3c

Browse files
committed
Fix: i686 test difference test_normalfloat
1 parent de8d398 commit 23fdc3c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/test_hyperparameters.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,17 @@ def test_normalfloat(self):
294294
self.assertEqual(
295295
"param, Type: NormalFloat, Mu: 5.0 Sigma: 10.0, Range: [0.1, 10.0], " +
296296
"Default: 5.0, on log-scale, Q: 0.1", str(f6))
297-
self.assertEqual(f6.get_neighbors(5, rs=np.random.RandomState(42)),
298-
[9.967141530112327, 3.6173569882881536, 10.0, 10.0])
297+
298+
# Due to seemingly different numbers with x86_64 and i686 architectures
299+
# we got these numbers, where the first one is slightly different
300+
# [9.967141530112325, 3.6173569882881536, 10.0, 10.0]
301+
# They are equal up to 14 decimal places
302+
expected = [9.967141530112327, 3.6173569882881536, 10.0, 10.0]
303+
np.testing.assert_almost_equal(
304+
f6.get_neighbors(5, rs=np.random.RandomState(42)),
305+
expected,
306+
decimal=14
307+
)
299308

300309
self.assertNotEqual(f1, f2)
301310
self.assertNotEqual(f1, "UniformFloat")

0 commit comments

Comments
 (0)