Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Develop #6

Merged
merged 26 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0fab7b6
count points
lucbellicaud Mar 31, 2023
759ae4d
alert symbol instead of abbrevation
lucbellicaud Apr 3, 2023
2ba39b8
Squashed commit of the following:
lucbellicaud Apr 6, 2023
ca9b168
DDS lead
lucbellicaud Apr 12, 2023
54ff53b
feat: Add otel into development docker-compose
zdraganov Apr 13, 2023
10399da
Fix small cards dds 2
lucbellicaud Apr 13, 2023
4b6006d
Merge branch 'develop' of https://github.com/Seven-of-Di/ben into dev…
lucbellicaud Apr 13, 2023
9a1e5f0
test lead
lucbellicaud Apr 13, 2023
2660d36
Merge branch 'staging' into develop
lucbellicaud Apr 13, 2023
80bd6eb
feat: Intrument Ben with Tracing for PlayCard flow
zdraganov Apr 13, 2023
481b0db
feat: Add integrnal loadtest package for simplify running loadtests
zdraganov Apr 14, 2023
6c2fc07
feat: Update the README.md for the loadtest package
zdraganov Apr 14, 2023
421ac69
fixed big bug : not taking pb into account
lucbellicaud Apr 17, 2023
103ae6b
Merge branch 'develop' of https://github.com/Seven-of-Di/ben into dev…
lucbellicaud Apr 17, 2023
421e035
Update transform_play_card.py
lucbellicaud Apr 17, 2023
760dd47
feat: Reconstructure the code and add more samples
zdraganov Apr 18, 2023
52269b4
optimize sample ordering
lucbellicaud Apr 18, 2023
97aa583
Clean up variables names + time tricking
lucbellicaud Apr 18, 2023
1f007e0
feat: Change to use hypercorn
zdraganov Apr 18, 2023
f8c6873
Add some tracers
lucbellicaud Apr 18, 2023
0814048
Merge branch 'develop' of https://github.com/Seven-of-Di/ben into dev…
lucbellicaud Apr 18, 2023
3297b54
feat: Make the number of leading samples configurable
zdraganov Apr 19, 2023
d1073b6
Less redoubles + fix tracer of dds
lucbellicaud Apr 19, 2023
e111c6e
Merge branch 'develop' of https://github.com/Seven-of-Di/ben into dev…
lucbellicaud Apr 19, 2023
4ce4bbe
back to 100 samples
lucbellicaud Apr 19, 2023
4cbd2cb
feat: Include game information in the traces attributes
zdraganov Apr 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
count points
  • Loading branch information
lucbellicaud committed Mar 31, 2023
commit 0fab7b67e4eb157c1ea381aa7d305f7b52008633
2 changes: 1 addition & 1 deletion src/parsing_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_content_under_tag(string: str, tag : str) -> Optional[str]:
@staticmethod
def vul_from_string(string: str) -> Tuple[bool, bool]:
"""Return NS and EW vul from string : NS-> (True,False) """
if string == "None":
if string == "None" or string =="-":
return (False, False)
if string == "NS":
return (True, False)
Expand Down
20 changes: 17 additions & 3 deletions src/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,24 @@ def run_deal_on_both_rooms(deal: Deal, force_same_sequence: bool = False, force_

return "{}\n{}".format(open_room_board.print_as_pbn(open_room=True), closed_room_board.print_as_pbn(open_room=False))

def count_average_hcp() :
with open("./test_data/10K_ranked_deals.pbn") as f:
boards = f.read().strip("\n").split("\n\n")
deals: List[Deal] = [Deal.from_pbn(board) for board in boards]
hcp_per_dir = {dir:0 for dir in Direction}
for deal in deals :
for dir in Direction :
hcp_per_dir[dir]+=deal.diag.hands[dir].hcp()
average_hcp_per_dir = {dir:total_hcp/len(deals) for dir,total_hcp in hcp_per_dir.items()}
print(len(boards))
print(average_hcp_per_dir)

def run_tm_btwn_ben_versions(force_same_sequence: bool = False, force_same_lead: bool = False, force_same_card_play: bool = False):
with open("./test_data/test_data.pbn") as f:
boards = f.read().strip("\n").split("\n\n")
deals: List[Deal] = [Deal.from_pbn(board) for board in boards[:64]]
deals: List[Deal] = [Deal.from_pbn(board) for board in boards]



for deal in deals:
deal.diag = Diag.generate_random()
Expand Down Expand Up @@ -374,7 +387,8 @@ def compare_two_tests(set_of_boards_1: List[Board], set_of_boards_2: List[Board]
# compare_two_tests(load_test_pbn("avant.pbn"),
# load_test_pbn("après.pbn"))
# load_test_pbn("c4f380988fc67c0fe6e5f4bc5502d67a3b45d2c0.pbn")
link = r"https://play.intobridge.com/hand?lin=pn%7CStefan,Ben,Ben,Ben%7Cmd%7C3SAKJT54HAKQ74D73C,S972H65DKJ854CJ96,SQ63HT983DT2C7542,S8HJ2DAQ96CAKQT83%7Cah%7CBoard%205%7Cmb%7Cp%7Cmb%7C1C%7Cmb%7C1S%7Cmb%7Cp%7Cmb%7Cp%7Cmb%7C2D%7Cmb%7C4H%7Cmb%7Cp%7Cmb%7Cp%7Cmb%7Cd%7Cmb%7Cr%7Cmb%7Cp%7Cmb%7C5S%7Cmb%7Cp%7Cmb%7Cp%7Cmb%7Cd%7Cmb%7Cp%7Cmb%7Cp%7Cmb%7Cp%7Cpc%7CC6%7Cpc%7CC2%7Cpc%7CCQ%7Cpc%7CS4%7Cpc%7CSJ%7Cpc%7CS7%7Cpc%7CS3%7Cpc%7CS8%7Cpc%7CST%7Cpc%7CS2%7Cpc%7CS6%7Cpc%7CC3%7Cpc%7CSK%7Cpc%7CS9%7Cpc%7CSQ%7Cpc%7CH2%7Cpc%7CHA%7Cpc%7CH6%7Cpc%7CH8%7Cpc%7CHJ%7Cmc%7C11%7Csv%7Cn%7C"
# link = r"https://play.intobridge.com/hand?lin=pn%7CStefan,Ben,Ben,Ben%7Cmd%7C3SAKJT54HAKQ74D73C,S972H65DKJ854CJ96,SQ63HT983DT2C7542,S8HJ2DAQ96CAKQT83%7Cah%7CBoard%205%7Cmb%7Cp%7Cmb%7C1C%7Cmb%7C1S%7Cmb%7Cp%7Cmb%7Cp%7Cmb%7C2D%7Cmb%7C4H%7Cmb%7Cp%7Cmb%7Cp%7Cmb%7C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