Skip to content

Conversation

@edwardchalstrey1
Copy link
Member

@edwardchalstrey1 edwardchalstrey1 commented Jan 7, 2026

Issues closed by this PR

Description of the changes in this PR

This PR adds infrastructure for a catalog of games, with some examples of usage added to the tutorials 1 & 2

How to review this PR

...

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@edwardchalstrey1
Copy link
Member Author

edwardchalstrey1 commented Jan 8, 2026

@tturocy @rahulsavani I've implemented a draft of the catalog module in pygambit on this branch, this would already be a good point for you both to take a look at the approach and comment.

Take at catalog.py where you can see the two methods by which games can be added to the catalog:

  1. Games stored as files in contrib/games - the idea here is that you only need to define the metadata and name of the game file. I started by moving the game files around on this branch, but then I thought why not leave the contrib dir as is for now, and gradually add games from there to the catalog? We could also set up a separate dir for game files that we move the files that are definitely part of the catalog into e.g. /catalog, but for now they are loaded direct from contrib
  2. Games defined programatically - in these cases as well as defining the metadata, you also add a _game method, which can include custom parameters. This is how I see setting up the games currently defined in the test suite.

You can also see how the API works by looking at the ReviewNB link above and seeing in the tutorial examples the two features of the catalog so far:

  1. The games() function which allows you to list all games in the catalog - you can filter number of players or game type (efg/nfg)
  2. Loading a game from the catalog

At the moment, there are just 3 example games in the catalog. One key obstacle for just trawling the games in contrib and getting them all added now is how to think about a consistent naming convention. I could just use the filenames, but presumably we want something more robust as discussed.

…to avoid circular imports issue"

This reverts commit 4d46dd5.
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.

Create initial games catalog from contrib/games

2 participants