poker_ai.utils package

Submodules

poker_ai.utils.algos module

poker_ai.utils.algos.rotate_list(l: List[Any], n: int)

Helper function for rotating lists, typically list of Players

Parameters
  • l (List[Any]) – List to rotate.

  • n (int) – Integer index of where to rotate.

poker_ai.utils.debug module

Handy debugger for forked processes.

Invoke with ForkedPdb().set_trace()

class poker_ai.utils.debug.ForkedPdb(completekey='tab', stdin=None, stdout=None, skip=None, nosigint=False, readrc=True)

Bases: pdb.Pdb

A Pdb subclass that may be used from a forked multiprocessing child.

interaction(*args, **kwargs)

poker_ai.utils.io module

class poker_ai.utils.io.NumpyJSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)

Bases: json.encoder.JSONEncoder

Handle those pesky numpy arrays on serialisation.

default(obj)

Method to handle the conversion of numpy types to Python types.

poker_ai.utils.io.create_dir(dir_name: str = 'results') → pathlib.Path

Create and get a unique dir path to save to using a timestamp.

poker_ai.utils.io.load_info_set_lut(lut_path: Union[str, pathlib.Path], pickle_dir: bool)

Load the info set abstraction lookup table.

poker_ai.utils.io.print_strategy(strategy: Dict[str, Dict[str, int]])

Print strategy.

poker_ai.utils.io.to_dict(**kwargs) → Dict[str, Any]

Hacky method to convert weird collections dicts to regular dicts.

poker_ai.utils.logging module

poker_ai.utils.random module

poker_ai.utils.random.seed(seed: int = 42)

Set random seed for all libraries used to make program deterministic.

Module contents