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
Prev Previous commit
Next Next commit
Merge branch 'staging' into develop
  • Loading branch information
lucbellicaud committed Apr 13, 2023
commit 2660d3645681728cf329a35d533a9d5e2cda087f
6 changes: 3 additions & 3 deletions src/bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def restful_bid(self, auction) -> BidResp:
start = time.time()
auction = [element for element in auction if element != "PAD_START"]
self.getting_doubled = len(auction)>=3 and ((auction[-3:]==['X',"PASS","PASS"] ) or auction[-2:]==['XX',"PASS"])
self.min_candidate_score = 0.01 if self.getting_doubled else self.min_candidate_score
self.min_candidate_score = 0.01 if self.getting_doubled else self.min_candidate_score

position_minus_1 = len(auction) % 4

Expand Down Expand Up @@ -306,7 +306,7 @@ def lead(self, auction):
level = int(contract[0])
tricks_to_defeat_contract = 13-(6+level)+1
strain = bidding.get_strain_i(contract)

lead_card_indexes, lead_softmax = self.get_lead_candidates(auction)
accepted_samples = self.get_accepted_samples(
4096, auction, lead_card_indexes)
Expand Down Expand Up @@ -563,7 +563,7 @@ def get_base_diag() -> Diag:
print(" {}".format([i for i in range(len(samples_as_diag))]))
for key, value in (dd_solved.items()):
print(Card_.get_from_52(key), value)


return card_result

Expand Down
6 changes: 3 additions & 3 deletions src/generate_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def generate_suits_length_alert(bid_explanation: BidExplanations) -> str:
if len(long_suits) == 1 and len(short_suits) == 1 and suits_length_alert_as_dict[short_suits[0]]["usual_max_length"] <= 1:
return "Splinter : {}".format(suits_text)
if len(long_suits) == 1:
return "Two suiter : {} and another".format(suits_text)
return "{} and 4+ other".format(suits_text)
else:
return "Unknown two suiter".format()

Expand All @@ -217,7 +217,7 @@ def generate_suits_length_alert(bid_explanation: BidExplanations) -> str:
return "{}".format(suits_text)


def generate_alert_from_bid_explanation(bid_explanation: BidExplanations) -> str | None:
def generate_alert_from_bid_explanation(bid_explanation: BidExplanations) -> str|None:
if bid_explanation.n_samples >= 5:
# print("Number of samples : {}".format(bid_explanation.n_samples))
hcp_text = generete_hcp_alert(bid_explanation=bid_explanation)
Expand All @@ -239,5 +239,5 @@ def request_from_pickle_file(str_sequence: List[str]) -> BidExplanations:

if __name__ == "__main__":
generate_alerts(1000)
# print(request_from_pickle_file(["2N"]).hcp_distribution)
# request_from_pickle_file(["2N","PASS","3S"])
# print(manual_alert(["PASS", "PASS", "1S"]))
4 changes: 2 additions & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ def __repr__(self) -> str:
return f"PlayerHand({repr_str})"

def __str__(self) -> str:
suit_arrays = [["♠"], ["♥"],
["♦"], ["♣"]]
suit_arrays = [[SPADES_SYMBOL], [HEARTS_SYMBOL],
[DIAMONDS_SYMBOL], [CLUBS_SYMBOL]]
for card in sorted(self.cards, reverse=True):
suit_arrays[card.suit.value].append(repr(card))
repr_str = " ".join("".join(suit) for suit in suit_arrays)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.