Skip to content

UndefinedOperationError for game.player.{actions,infosets} on non-tree#701

Merged
tturocy merged 2 commits intomasterfrom
issue_696
Dec 15, 2025
Merged

UndefinedOperationError for game.player.{actions,infosets} on non-tree#701
tturocy merged 2 commits intomasterfrom
issue_696

Conversation

@rahulsavani
Copy link
Copy Markdown
Member

closes issue #696

@rahulsavani rahulsavani requested a review from tturocy December 15, 2025 10:21
@rahulsavani
Copy link
Copy Markdown
Member Author

In fixing this, I noticed that a bunch of functions on Game that only work for trees currently do not raise an UndefinedOperationError.

@tturcoy: Do we think that UndefinedOperationError should be raised by all of the following Game operations when called on a "non-tree"?

nodes, set_chance_probs, append_move, append_infoset, insert_move, insert_infoset, copy_tree, move_tree, delete_parent, delete_tree, add_action, delete_action, leave_infoset, set_infoset, reveal, sort_infosets.

If so, I can add an issue and add these errors and corresponding tests.

@tturocy
Copy link
Copy Markdown
Member

tturocy commented Dec 15, 2025

I would say yes, please add a similar check to nodes as part of this PR.

For the others, they will all inherently fail because there'll be a game mismatch error because the parameter(s) of the functions won't belong to the game. So the check would largely be redundant - and at the end of the day the error that's raised now is also correct.

Copy link
Copy Markdown
Member

@tturocy tturocy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per comment - add this check to nodes as well please. Other functions looks like they're fine.

@rahulsavani
Copy link
Copy Markdown
Member Author

Per comment - add this check to nodes as well please. Other functions looks like they're fine.

I added for nodes but also for sort_infosets (agree w.r.t. to all other functions that I mentioned: these will all raise other errors already that are correct too).

@rahulsavani rahulsavani requested a review from tturocy December 15, 2025 15:47
@tturocy tturocy merged commit 666ad00 into master Dec 15, 2025
28 checks passed
@tturocy tturocy deleted the issue_696 branch December 15, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants