dominicprice / endplay

A suite of tools for generation and analysis of bridge deals. Read the documentation at https://endplay.readthedocs.io
MIT License
21 stars 5 forks source link

CCCC calculation is 0.5 or 1.0 too high #35

Closed tameware closed 4 months ago

tameware commented 4 months ago

I learned from a site that uses endplay that its CCCC calculation was always too high. I installed endplay to check for myself and sure enough, there's a failing test:

FAILED tests/test_evaluate.py::TestEvaluate::test_cccc - AssertionError: 13.8 != 12.8

The algorithm as described on the late Jeff Goldsmith's site contains a "discount the first doubleton" step. More precisely, that means sum the shortness points for all four suits, then subtract 0.5 if the shape is 4333 and subtract 1.0 otherwise.

I've forced the other test cases to run and the 4333 calculation is too high by 0.5 while the others are too high by 1.0. I expect that adding a subtraction step as above will fix this.

tameware commented 4 months ago

Aha! I see that the source code includes this step. I might not be using the latest version. I'll install from the repo, run the test again, and report back.

tameware commented 4 months ago

This was fixed by https://github.com/dominicprice/endplay/pull/33. The fix has not yet made it into a release. I'll leave this open for now - it can be closed after the next release.

dominicprice commented 4 months ago

I'll make the release this evening

dominicprice commented 4 months ago

fix released in https://pypi.org/project/endplay/