Skip to content

Commit 5f782ce

Browse files
committed
Tidy up tests now that information set sorting is obsolete.
1 parent 8375d98 commit 5f782ce

2 files changed

Lines changed: 0 additions & 16 deletions

File tree

tests/games.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from abc import ABC, abstractmethod
66

77
import numpy as np
8-
import pytest
98

109
import pygambit as gbt
1110

@@ -353,7 +352,6 @@ def create_3_player_with_internal_outcomes_efg(nonterm_outcomes: bool = False) -
353352
o = g.add_outcome([0, 0, 0])
354353
g.set_outcome(g.root.children[0].children[0].children[1].children[0], o)
355354
g.set_outcome(g.root.children[0].children[0].children[1].children[1], o)
356-
# g.sort_infosets()
357355
return g
358356

359357

@@ -651,10 +649,6 @@ def create_kuhn_poker_efg(nonterm_outcomes: bool = False) -> gbt.Game:
651649
g = _create_kuhn_poker_efg_nonterm_outcomes()
652650
else:
653651
g = _create_kuhn_poker_efg_only_term_outcomes()
654-
655-
# Ensure infosets are in the same order as if game was written to efg and read back in
656-
with pytest.warns(FutureWarning):
657-
g.sort_infosets()
658652
return g
659653

660654

@@ -909,7 +903,6 @@ def create_STOC_simplified() -> gbt.Game:
909903
g.root.children[1].children[1],
910904
outcome=g.add_outcome(payoffs=[20, -20], label="d"),
911905
)
912-
# g.sort_infosets()
913906
return g
914907

915908

@@ -949,7 +942,6 @@ def create_STOC_simplified2() -> gbt.Game:
949942
g.root.children[1].children[0],
950943
outcome=g.add_outcome(payoffs=[10, -10], label="c"),
951944
)
952-
# g.sort_infosets()
953945
return g
954946

955947

@@ -1031,7 +1023,6 @@ def create_seq_form_STOC_paper_zero_sum_2_player_efg() -> gbt.Game:
10311023
g.root.children[0].children[1].infoset.label = "01"
10321024
g.root.children[2].children[0].infoset.label = "20"
10331025
g.root.children[0].children[1].children[0].infoset.label = "010"
1034-
g.sort_infosets()
10351026
return g
10361027

10371028

tests/test_nash.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ def test_lcp_behavior_rational(game: gbt.Game, mixed_behav_prof_data: list):
608608
using max_regret and agent_max_regret (internal consistency); and
609609
comparison to a previously computed equilibrium using this function (regression test).
610610
"""
611-
game.sort_infosets()
612611
result = gbt.nash.lcp_solve(game, use_strategic=False, rational=True)
613612
assert len(result.equilibria) == 1
614613
eq = result.equilibria[0]
@@ -786,15 +785,12 @@ def test_lp_behavior_rational(game: gbt.Game, mixed_behav_prof_data: list):
786785
using max_regret and agent_max_regret (internal consistency); and
787786
comparison to a previously computed equilibrium using this function (regression test).
788787
"""
789-
game.sort_infosets()
790788
result = gbt.nash.lp_solve(game, use_strategic=False, rational=True)
791789
assert len(result.equilibria) == 1
792790
eq = result.equilibria[0]
793791
assert eq.max_regret() == 0
794792
assert eq.agent_max_regret() == 0
795793
expected = game.mixed_behavior_profile(rational=True, data=mixed_behav_prof_data)
796-
print(expected)
797-
print(eq)
798794
assert eq == expected
799795

800796

@@ -975,11 +971,8 @@ def test_regrets_tmp2():
975971
],
976972
)
977973
def test_repeat_max_regret(game: gbt.Game, mixed_behav_prof_data: list):
978-
game.sort_infosets()
979974
profile1 = game.mixed_behavior_profile(rational=True, data=mixed_behav_prof_data)
980975
mr1 = profile1.max_regret()
981976
profile2 = game.mixed_behavior_profile(rational=True, data=mixed_behav_prof_data)
982977
mr2 = profile2.max_regret()
983-
print()
984-
print(mr1, mr2)
985978
assert mr1 == mr2

0 commit comments

Comments
 (0)