Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #89

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
steps:
Expand Down
16 changes: 8 additions & 8 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def test_UCB1_c2(self):
is_predict=True,
n_jobs=1)

self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[1, 3, 1, 1, 1, 1, 1, 3, 3, 1] for _ in range(5)])

arm, mab = self.predict(arms=[1, 2, 3, 4],
decisions=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4],
Expand All @@ -250,7 +250,7 @@ def test_UCB1_c2(self):
is_predict=True,
n_jobs=2)

self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[1, 3, 1, 1, 1, 1, 1, 3, 3, 1] for _ in range(5)])

arm, mab = self.predict(arms=[1, 2, 3, 4],
decisions=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4],
Expand All @@ -264,7 +264,7 @@ def test_UCB1_c2(self):
is_predict=True,
n_jobs=100)

self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[1, 3, 1, 1, 1, 1, 1, 3, 3, 1]for _ in range(5)])

def test_greedy1_k2(self):
rng = np.random.RandomState(seed=7)
Expand Down Expand Up @@ -562,7 +562,7 @@ def test_thompson_n3(self):
is_predict=True,
n_jobs=2)

self.assertListEqual(arms, [3, 2, 1, 1, 1, 1, 2, 1, 3, 1])
self.assertListEqual(arms, [1, 1, 1, 1, 1, 1, 1, 3, 1, 1])

arms, mab = self.predict(arms=[1, 2, 3],
decisions=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
Expand All @@ -576,7 +576,7 @@ def test_thompson_n3(self):
is_predict=True,
n_jobs=-1)

self.assertListEqual(arms, [3, 2, 3, 2, 2, 2, 3, 3, 2, 3])
self.assertListEqual(arms, [2, 2, 2, 2, 3, 2, 2, 2, 3, 1])

def test_thompson_a2(self):

Expand Down Expand Up @@ -879,7 +879,7 @@ def test_UCB1_c2_backend(self):
n_jobs=2,
backend=None)

self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[1, 3, 1, 1, 1, 1, 1, 3, 3, 1] for _ in range(5)])

arm, mab = self.predict(arms=[1, 2, 3, 4],
decisions=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4],
Expand All @@ -894,7 +894,7 @@ def test_UCB1_c2_backend(self):
n_jobs=2,
backend='loky')

self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[1, 3, 1, 1, 1, 1, 1, 3, 3, 1] for _ in range(5)])

arm, mab = self.predict(arms=[1, 2, 3, 4],
decisions=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4],
Expand All @@ -909,7 +909,7 @@ def test_UCB1_c2_backend(self):
n_jobs=2,
backend='threading')

self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[1, 3, 1, 1, 1, 1, 1, 3, 3, 1] for _ in range(5)])

def test_greedy1_k2_backend(self):
rng = np.random.RandomState(seed=7)
Expand Down
Loading