Skip to content

Support pygambit 17 action interface; fix tests for pygambit >= 16.7.0 - #117

Open
d-kad wants to merge 2 commits into
mainfrom
action-interface-17
Open

Support pygambit 17 action interface; fix tests for pygambit >= 16.7.0#117
d-kad wants to merge 2 commits into
mainfrom
action-interface-17

Conversation

@d-kad

@d-kad d-kad commented Aug 27, 2026

Copy link
Copy Markdown

Description of the changes in this PR

Updates gtdraw for the removal of the Action object in pygambit 17 (gambitproject/gambit#1078), and fixes test breakage.

gambit_layout.py: a chance action's probability moved from node.prior_action.prob to Infoset.action_probs[label]. One call site, branch inlined.

Detection is by hasattr, not by version string: pygambit 17.0.0a1 and 17.0.0a2 are published and still carry the old interface, so a 16/17 major-version check misclassifies them. The real boundary is 17.0.0b1.

node.prior_action.label needs no change — the new Branch named tuple keeps .label. (The ChangeLog note in #1078 saying this breaks gtdraw predates the commit that introduced Branch.)

The pygambit 16 arms are temporary. Once 17.0.0b1 is on PyPI: pin pygambit>=17.0.0b1, delete the three else arms (one in gambit_layout.py, two in the chance tests), and rewrite the chance construction as plain append_event.

@d-kad
d-kad requested a review from tturocy August 27, 2026 07:29
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.

1 participant