Skip to content
Merged
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
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
to the left, wrapping if appropriate).
- Max regret is calculated correctly for strategy and behavior profiles on games with zero player
strategies or actions (is defined to be 0 trivially) (#904)
- Corrected calculation of total number of actions for a player in `pygambit` (#938)

### Changed
- Added a new welcome/landing window on launching the GUI without a game. This has the effect of
Expand Down
2 changes: 1 addition & 1 deletion src/pygambit/player.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class PlayerActions:
return f"PlayerActions(player={self.player})"

def __len__(self) -> int:
return sum(len(s.actions) for s in self.player.actions)
return sum(len(s.actions) for s in self.player.infosets)

def __iter__(self) -> typing.Iterator[Action]:
for infoset in self.player.infosets:
Expand Down
6 changes: 6 additions & 0 deletions tests/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,9 @@ def test_strategy_action_raises_error_for_strategic_game():

with pytest.raises(gbt.UndefinedOperationError):
strategy.action(test_infoset)


def test_player_actions_len():
game = games.create_stripped_down_poker_efg()
for player in game.players:
assert len(player.actions) == len(list(player.actions))
Loading