Skip to content

Commit 573c8e4

Browse files
committed
minor tweaks
1 parent ab4474f commit 573c8e4

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

tests/games.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def read_from_file(fn: str) -> gbt.Game:
1818
raise ValueError(f"Unknown file extension in {fn}")
1919

2020

21-
def create_efg_corresponding_to_bimatrix_Game(
21+
def create_efg_corresponding_to_bimatrix_game(
2222
A: np.ndarray, B: np.ndarray, title: str
2323
) -> gbt.Game:
2424
"""
@@ -601,7 +601,7 @@ def create_EFG_for_nxn_bimatrix_coordination_game(n: int) -> gbt.Game:
601601
A = np.eye(n, dtype=int)
602602
B = A
603603
title = f"{n}x{n} coordination game, {2**n - 1} equilibria"
604-
return create_efg_corresponding_to_bimatrix_Game(A, B, title)
604+
return create_efg_corresponding_to_bimatrix_game(A, B, title)
605605

606606

607607
def create_EFG_for_6x6_bimatrix_with_long_LH_paths_and_unique_eq() -> gbt.Game:
@@ -626,7 +626,7 @@ def create_EFG_for_6x6_bimatrix_with_long_LH_paths_and_unique_eq() -> gbt.Game:
626626
A = np.array(A)
627627
B = np.array(B)
628628
title = "6x6 Long Lemke-Howson Paths, unique eq"
629-
return create_efg_corresponding_to_bimatrix_Game(A, B, title)
629+
return create_efg_corresponding_to_bimatrix_game(A, B, title)
630630

631631

632632
class EfgFamilyForReducedStrategicFormTests(ABC):

tests/test_extensive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def test_outcome_index_exception_label():
377377
],
378378
)
379379
def test_reduced_strategic_form(
380-
game: gbt.Game, strategy_labels: list, np_arrays_of_rsf: list
380+
game: gbt.Game, strategy_labels: list, np_arrays_of_rsf: typing.Union[list, None]
381381
):
382382
"""
383383
We test two things:

tests/test_nash.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
For many solvers the tests simply ensure that calling the solver works, and then for some cases,
44
checking the expected results on a very simple game.
55
6-
Better test coverage is there for lp_solve, lcp_solve, and enumpoly_solve for behavior strategies.
6+
There is better test coverage for
7+
lp_solve, lcp_solve, and enumpoly_solve, all in behavior strategies.
78
"""
89
import typing
910

@@ -28,8 +29,9 @@ def test_enumpure_agent():
2829
assert len(gbt.nash.enumpure_solve(game, use_strategic=False).equilibria) == 0
2930

3031

31-
def test_enummixed_strategy_double():
32-
"""Test calls of enumeration of mixed strategy equilibria, floating-point."""
32+
def test_enummixed_double():
33+
"""Test calls of enumeration of mixed strategy equilibria for 2-player games, floating-point.
34+
"""
3335
game = games.read_from_file("poker.efg")
3436
result = gbt.nash.enummixed_solve(game, rational=False)
3537
assert len(result.equilibria) == 1
@@ -38,7 +40,7 @@ def test_enummixed_strategy_double():
3840

3941
@pytest.mark.nash
4042
@pytest.mark.nash_enummixed_strategy
41-
def test_enummixed_strategy_rational():
43+
def test_enummixed_rational():
4244
"""Test calls of enumeration of mixed strategy equilibria, rational precision."""
4345
game = games.read_from_file("poker.efg")
4446
result = gbt.nash.enummixed_solve(game, rational=True)
@@ -100,8 +102,8 @@ def test_enummixed_strategy_rational():
100102
[[["1/2", "1/2"]], [["2/5", "3/5"]], [["1/4", "3/4"]]],
101103
[[["2/5", "3/5"]], [["1/2", "1/2"]], [["1/3", "2/3"]]],
102104
],
103-
2,
104-
), # 9 in total found by enumpoly
105+
2, # 9 in total found by enumpoly
106+
),
105107
],
106108
)
107109
def test_enumpoly_behavior_strategy_rational(
@@ -158,7 +160,7 @@ def test_lcp_mixed_strategy_rational():
158160
assert result.equilibria[0] == expected
159161

160162

161-
def test_lcp_behavior_strategy_floating():
163+
def test_lcp_behavior_strategy_double():
162164
"""Test calls of LCP for mixed behavior equilibria, floating-point."""
163165
game = games.read_from_file("poker.efg")
164166
result = gbt.nash.lcp_solve(game, use_strategic=False, rational=False)
@@ -258,7 +260,7 @@ def test_lp_mixed_strategy_rational():
258260
assert result.equilibria[0] == expected
259261

260262

261-
def test_lp_behavior_strategy_floating():
263+
def test_lp_behavior_strategy_double():
262264
"""Test calls of LP for mixed behavior equilibria, floating-point."""
263265
game = games.read_from_file("poker.efg")
264266
result = gbt.nash.lp_solve(game, use_strategic=False, rational=False)

0 commit comments

Comments
 (0)