endplay.dds.analyse

Analysis functions from the DDS library, which calculate the double dummy number of tricks available given a play history.

Classes:

SolvedPlay(data)

SolvedPlayList(data)

Functions:

analyse_all_plays(deals, plays[, ...])

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

analyse_all_starts(deals[, declarer_is_first])

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

analyse_play(deal, play[, declarer_is_first])

Calculate a list of double dummy values after each card in play is played to the hand.

analyse_start(deal[, declarer_is_first])

Calculate the most tricks declarer can make.

class endplay.dds.analyse.SolvedPlay(data: solvedPlay)

Bases: Sequence

Attributes:

_abc_impl

_abc_impl = <_abc._abc_data object>
class endplay.dds.analyse.SolvedPlayList(data: solvedPlays)

Bases: Sequence

Attributes:

_abc_impl

_abc_impl = <_abc._abc_data object>
endplay.dds.analyse.analyse_all_plays(deals: Iterable[Deal], plays: Iterable[Iterable[Card]], declarer_is_first: bool = False) SolvedPlayList

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

endplay.dds.analyse.analyse_all_starts(deals: Iterable[Deal], declarer_is_first: bool = False) list[int]

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

endplay.dds.analyse.analyse_play(deal: Deal, play: Iterable[Union[Card, str]], declarer_is_first: bool = False) SolvedPlay

Calculate a list of double dummy values after each card in play is played to the hand. This returns len(play)+1 results, as there is also a result before any card has been played

endplay.dds.analyse.analyse_start(deal: Deal, declarer_is_first: bool = False) int

Calculate the most tricks declarer can make.

Parameters:
  • deal – The deal to analyse

  • declarer_is_first – The algorithm assumes that the person who leads is to the left of the declarer (as would be the case with the first card led to a hand), but to return the result as seen from the leader’s perspective you can set this to True