Skip to content

Commit

Permalink
update to remove "divide by 0" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienT01 committed Oct 23, 2024
1 parent 0fc8c9f commit b8f378c
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions rlberry/manager/tests/test_comparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
import pandas as pd


it = 1


class DummyAgent(AgentWithSimplePolicy):
def __init__(self, env, eval_val=0, **kwargs):
global it
AgentWithSimplePolicy.__init__(self, env, **kwargs)
self.name = "DummyAgent"
self.fitted = False
self.eval_val = eval_val
# self.eval_val = eval_val
self.eval_val = it
it += 1

self.total_budget = 0.0

Expand Down Expand Up @@ -69,7 +75,29 @@ def test_compare(method, source):
data_source = pd.DataFrame(
{
"agent": (["Agent 1"] * 10) + (["Agent 2"] * 10),
"mean_eval": ([0] * 10) + ([10] * 10),
# "mean_eval": ([0] * 10) + ([10] * 10),
"mean_eval": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
],
}
)

Expand Down

0 comments on commit b8f378c

Please sign in to comment.