Skip to content

Refer to strategies exclusively by labels in pygambit - #1096

Merged
tturocy merged 5 commits into
masterfrom
dev_contingency
Aug 29, 2026
Merged

Refer to strategies exclusively by labels in pygambit#1096
tturocy merged 5 commits into
masterfrom
dev_contingency

Conversation

@tturocy

@tturocy tturocy commented Aug 29, 2026

Copy link
Copy Markdown
Member

This implements several interlocking changes to pygambit to standardise how strategies are referenced.

  • Strategies are now referred to exclusively by their unique (within a player) labels. The Strategy object, which actually held a reference to the underlying C++ object, has been removed, in line with overall plans for Gambit 17.
  • Building on the recent implementation of make_outcome, the semi-undocumented access to the strategic form via the __getitem__ operator has been removed, in favour of get_outcome and get_payoffs operations on the game.
  • The implementations of calling external tools PHCpack and lrslib had drifted as they were not being tested; this adds tests to ensure they stay aligned with any further evolution to the API for strategies.

This removes `__getitem__` from games, which was an implicit way to access the strategic form, including deprecated integer index.

Instead, this introduces `get_outcome` and `get_payoffs`, which allows more explicit access via proper strategy profile mappings.
Now that all strategies must have nonempty, unique labels (for a player), this collection simply iterates over the strategy labels rather than materialising objects referring to internals of the game representation.
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@tturocy
tturocy merged commit 0121703 into master Aug 29, 2026
26 checks passed
@tturocy
tturocy deleted the dev_contingency branch August 29, 2026 09:59
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