Skip to content

Commit

Permalink
Add a float conversion to please MyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
e10e3 committed Jul 22, 2024
1 parent 6954f39 commit fc08439
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions river/bandit/test_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_better_than_random_policy(policy: bandit.base.Policy, env: gym.Env):
arm_id = policy.pull(arm_ids) # type: ignore
observation, reward, terminated, truncated, info = env.step(arm_id)
policy.update(arm_id, reward)
policy_reward += reward
policy_reward += float(reward)

random_arm_id = random_policy.pull(arm_ids) # type: ignore
(
Expand All @@ -122,7 +122,7 @@ def test_better_than_random_policy(policy: bandit.base.Policy, env: gym.Env):
info,
) = random_env.step(random_arm_id)
random_policy.update(random_arm_id, reward)
random_reward += reward
random_reward += float(reward)

n_successes += policy_reward > random_reward

Expand Down

0 comments on commit fc08439

Please sign in to comment.