Skip to content

Add read_bagg to pygambit game I/O API#933

Merged
rahulsavani merged 1 commit into
masterfrom
copilot/pygambit-game-read-bagg
Jun 6, 2026
Merged

Add read_bagg to pygambit game I/O API#933
rahulsavani merged 1 commit into
masterfrom
copilot/pygambit-game-read-bagg

Conversation

Copilot AI commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for contributing to Gambit! Before you submitting or reviewing a pull request, check out our guidelines for contributing.

The person submitting the PR should ensure it has an informative title and update the headers below, before marking the PR as ready for review and assigning reviewers.

Issues closed by this PR

Issue linking is handled automatically by the system.

Description of the changes in this PR

pygambit exposed read_agg but not a corresponding BAGG reader, so BAGG files could not be loaded through the Python game I/O API. This change adds first-class BAGG read support via read_bagg.

This PR ...

  • Python API surface

    • Adds read_bagg(filepath_or_buffer, normalize_labels=False) to the game I/O API, parallel to read_efg / read_nfg / read_agg.
  • Cython/C++ parser wiring

    • Adds ParseBaggGame in the wrapper layer and wires it through gambit.pxd so read_bagg resolves to ReadBaggFile.
  • API docs

    • Adds read_bagg to the pygambit API autosummary list.
  • I/O coverage

    • Adds BAGG read-path coverage for both valid BAGG input and invalid-format rejection.
import pygambit as gbt

game = gbt.read_bagg("contrib/games/Bayesian-Coffee-3-2-2-3.bagg")

How to review this PR

  • Confirm read_bagg is exposed in the same layer as existing file readers (read_efg, read_nfg, read_agg).
  • Verify parser plumbing from Python entrypoint to ReadBaggFile.
  • Check docs autosummary includes read_bagg.
  • Review the new BAGG I/O tests for success and parse-error paths.

@rahulsavani rahulsavani marked this pull request as ready for review June 6, 2026 17:07
@rahulsavani rahulsavani merged commit abfd3b7 into master Jun 6, 2026
26 checks passed
@rahulsavani rahulsavani deleted the copilot/pygambit-game-read-bagg branch June 6, 2026 17:07
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.

3 participants