You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Game objects currently just have generic .read_game and .write_game operations, where .write_game takes a format parameter to determine the output format, while .read_game tries various formats until one is successful.
Looking at e.g. pandas, it seems it would be better to have functions that explicitly read and write the different supported formats.
The text was updated successfully, but these errors were encountered:
The functions for reading files will be module-level in pygambit. (The current functions are all part of the Game class.)
When reading, the first argument should be a string, path object, or file-like object, just like read_* in pandas.
When writing, the first argument is optional, and can be a string, path object, or file-like object, or null. If null, the function returns the serialised string representation.
We will have the following functions (please add a note if there are others that are missing)
Reading
read_efg - reads an .efg file format
read_nfg - reads an .nfg file format
read_gbt - reads a .gbt file (XML files produced by the GUI)
read_agg - reads an action-graph games file format
Writing
Game.to_efg - writes an .efg file
Game.to_nfg - writes an .nfg file
Game.to_gbt - writes a .gbt file
Game.to_html - writes out HTML tables
Game.to_latex - currently the sgame format supported by Game.write.
(there is not at present support for writing out AGG files so no need to have this as yet)
The function Game.parse_game will be deprecated, as its functionality can be replicated by wrapping such a string in an io.StringIO object and then passing it to the appropriate read_* function as above, which functions will now accept file-like objects.
Game
objects currently just have generic.read_game
and.write_game
operations, where.write_game
takes aformat
parameter to determine the output format, while.read_game
tries various formats until one is successful.Looking at e.g.
pandas
, it seems it would be better to have functions that explicitly read and write the different supported formats.The text was updated successfully, but these errors were encountered: