endplay.dds.ddtable

Double dummy table calculation functions

Classes:

DDTable(data)

Python wrapper for the _dds.ddTableResults class.

DDTableList(data)

Functions:

calc_all_tables(deals[, exclude])

Optimized version of calc_dd_table for multiple deals which uses threading to speed up the calculation.

calc_dd_table(deal)

Calculates the double dummy results for all 20 possible combinations of dealer and trump suit for a given deal

class endplay.dds.ddtable.DDTable(data: ddTableResults)

Bases: object

Python wrapper for the _dds.ddTableResults class. Entries can be accessed using the __getitem__ operator e.g. table[Denom.clubs, Player.west]

Methods:

pprint(*[, denoms, players, stream])

Print the double dummy table in a grid format

to_LaTeX()

Create a LaTeX string of the table

to_list([player_major])

Convert the table to a 2d list

pprint(*, denoms: ~collections.abc.Iterable[~endplay.types.denom.Denom] = [<Denom.clubs: 3>, <Denom.diamonds: 2>, <Denom.hearts: 1>, <Denom.spades: 0>, <Denom.nt: 4>], players: ~collections.abc.Iterable[~endplay.types.player.Player] = [<Player.north: 0>, <Player.south: 2>, <Player.east: 1>, <Player.west: 3>], stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) None

Print the double dummy table in a grid format

Parameters:
  • denoms – Specify the columns of the table

  • players – Specify the rows of the table

to_LaTeX() str

Create a LaTeX string of the table

to_list(player_major: bool = False) list[list[int]]

Convert the table to a 2d list

Parameters:

player_major – If True, the returned list is index by player first then strain

class endplay.dds.ddtable.DDTableList(data: _dds.ddTableRes)

Bases: Sequence

Attributes:

_abc_impl

_abc_impl = <_abc._abc_data object>
endplay.dds.ddtable.calc_all_tables(deals: Iterable[Deal], exclude: Iterable[Denom] = []) DDTableList

Optimized version of calc_dd_table for multiple deals which uses threading to speed up the calculation. exclude can contain a list of denominations to exclude from the calculation, e.g. if only the notrump results for the deals is required then pass Denom.suits()

endplay.dds.ddtable.calc_dd_table(deal: Deal) DDTable

Calculates the double dummy results for all 20 possible combinations of dealer and trump suit for a given deal