kaggle-environments 1.23.10__py3-none-any.whl → 1.23.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kaggle-environments might be problematic. Click here for more details.
- kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/components/getRepeatedPokerStateForStep.js +10 -19
- kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/repeated_poker_renderer.js +28 -16
- {kaggle_environments-1.23.10.dist-info → kaggle_environments-1.23.11.dist-info}/METADATA +1 -1
- {kaggle_environments-1.23.10.dist-info → kaggle_environments-1.23.11.dist-info}/RECORD +7 -7
- {kaggle_environments-1.23.10.dist-info → kaggle_environments-1.23.11.dist-info}/WHEEL +0 -0
- {kaggle_environments-1.23.10.dist-info → kaggle_environments-1.23.11.dist-info}/entry_points.txt +0 -0
- {kaggle_environments-1.23.10.dist-info → kaggle_environments-1.23.11.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getActionStringsFromACPC } from
|
|
1
|
+
import { getActionStringsFromACPC } from '@kaggle-environments/core';
|
|
2
2
|
|
|
3
3
|
const PLACEHOLDER_CARD = '2c';
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ function _parseStepHistoryData(universalPokerJSON, nextPlayerIndex, numPlayers =
|
|
|
8
8
|
communityCards: '',
|
|
9
9
|
bets: [],
|
|
10
10
|
playerActionStrings: Array(numPlayers).fill(''),
|
|
11
|
-
winOdds: [0, 0]
|
|
11
|
+
winOdds: [0, 0]
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
if (!universalPokerJSON) {
|
|
@@ -52,18 +52,11 @@ function _parseStepHistoryData(universalPokerJSON, nextPlayerIndex, numPlayers =
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
result.communityCards = cardSegments
|
|
56
|
-
.slice(1)
|
|
57
|
-
.filter(Boolean)
|
|
58
|
-
.join('');
|
|
55
|
+
result.communityCards = cardSegments.slice(1).filter(Boolean).join('');
|
|
59
56
|
|
|
60
57
|
const bettingString = stateParts.slice(2, stateParts.length - 1).join(':');
|
|
61
58
|
if (bettingString) {
|
|
62
|
-
result.playerActionStrings = getActionStringsFromACPC(
|
|
63
|
-
bettingString,
|
|
64
|
-
nextPlayerIndex,
|
|
65
|
-
numPlayers
|
|
66
|
-
);
|
|
59
|
+
result.playerActionStrings = getActionStringsFromACPC(bettingString, nextPlayerIndex, numPlayers);
|
|
67
60
|
}
|
|
68
61
|
}
|
|
69
62
|
|
|
@@ -96,8 +89,6 @@ function sanitizeCardList(cards) {
|
|
|
96
89
|
return (cards || []).filter((card) => card);
|
|
97
90
|
}
|
|
98
91
|
|
|
99
|
-
|
|
100
|
-
|
|
101
92
|
function getCommunityCardsFromUniversal(universal, numPlayers) {
|
|
102
93
|
const parsed = _parseStepHistoryData(universal, null, numPlayers);
|
|
103
94
|
const cards = splitCards(parsed.communityCards);
|
|
@@ -118,9 +109,6 @@ function getHandCardsFromUniversal(universal, numPlayers) {
|
|
|
118
109
|
});
|
|
119
110
|
}
|
|
120
111
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
112
|
function getUniversalState(environment, index) {
|
|
125
113
|
const entry = environment?.info?.stateHistory?.[index];
|
|
126
114
|
if (!entry) {
|
|
@@ -157,7 +145,8 @@ export const getPokerStateForStep = (environment, step) => {
|
|
|
157
145
|
);
|
|
158
146
|
|
|
159
147
|
const startingStacks = stateInfo.universal?.starting_stacks || Array(numPlayers).fill(0);
|
|
160
|
-
const contributions =
|
|
148
|
+
const contributions =
|
|
149
|
+
stateInfo.universal?.player_contributions || parsedStateHistory.bets || Array(numPlayers).fill(0);
|
|
161
150
|
const rewards = stateInfo.outer?.hand_returns || [];
|
|
162
151
|
const communityCards = getCommunityCardsFromUniversal(stateInfo.universal, numPlayers);
|
|
163
152
|
|
|
@@ -177,7 +166,8 @@ export const getPokerStateForStep = (environment, step) => {
|
|
|
177
166
|
isTurn: stateInfo.universal?.current_player === i,
|
|
178
167
|
isLastActor: event.highlightPlayer === i,
|
|
179
168
|
reward: rewards[0]?.[i] ?? null,
|
|
180
|
-
actionDisplayText: event.highlightPlayer === i ? event.actionText : ''
|
|
169
|
+
actionDisplayText: event.highlightPlayer === i ? event.actionText : '',
|
|
170
|
+
handCount: 0
|
|
181
171
|
};
|
|
182
172
|
});
|
|
183
173
|
|
|
@@ -202,6 +192,7 @@ export const getPokerStateForStep = (environment, step) => {
|
|
|
202
192
|
winOdds: parsedStateHistory.winOdds,
|
|
203
193
|
fiveCardBestHands: [],
|
|
204
194
|
currentPlayer: stateInfo.universal?.current_player ?? -1,
|
|
205
|
-
winner: -1
|
|
195
|
+
winner: -1,
|
|
196
|
+
handCount: event.hand,
|
|
206
197
|
};
|
|
207
198
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getPokerStateForStep } from
|
|
2
|
-
import { acpcCardToDisplay, suitSVGs } from
|
|
3
|
-
import poker_chip_1 from
|
|
4
|
-
import poker_chip_5 from
|
|
5
|
-
import poker_chip_10 from
|
|
6
|
-
import poker_chip_25 from
|
|
7
|
-
import poker_chip_100 from
|
|
1
|
+
import { getPokerStateForStep } from './components/getRepeatedPokerStateForStep';
|
|
2
|
+
import { acpcCardToDisplay, suitSVGs } from './components/utils';
|
|
3
|
+
import poker_chip_1 from './images/poker_chip_1.svg';
|
|
4
|
+
import poker_chip_5 from './images/poker_chip_5.svg';
|
|
5
|
+
import poker_chip_10 from './images/poker_chip_10.svg';
|
|
6
|
+
import poker_chip_25 from './images/poker_chip_25.svg';
|
|
7
|
+
import poker_chip_100 from './images/poker_chip_100.svg';
|
|
8
8
|
|
|
9
9
|
export function renderer(options) {
|
|
10
10
|
const chipImages = {
|
|
@@ -28,7 +28,8 @@ export function renderer(options) {
|
|
|
28
28
|
dealerButton: null,
|
|
29
29
|
chipStacks: [],
|
|
30
30
|
diagnosticHeader: null,
|
|
31
|
-
stepCounter: null
|
|
31
|
+
stepCounter: null,
|
|
32
|
+
handCounter: null
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const css = `
|
|
@@ -253,6 +254,12 @@ export function renderer(options) {
|
|
|
253
254
|
font-size: 14px; font-weight: 600;
|
|
254
255
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
255
256
|
}
|
|
257
|
+
.hand-counter {
|
|
258
|
+
position: absolute; bottom: 12px; right: 12px; z-index: 20;
|
|
259
|
+
color: #535965;
|
|
260
|
+
padding: 6px 12px; border-radius: 6px;
|
|
261
|
+
font-size: 40px; font-weight: 600;
|
|
262
|
+
}
|
|
256
263
|
.chip-stack {
|
|
257
264
|
position: absolute;
|
|
258
265
|
display: flex;
|
|
@@ -519,6 +526,12 @@ export function renderer(options) {
|
|
|
519
526
|
elements.stepCounter.className = 'step-counter';
|
|
520
527
|
elements.stepCounter.textContent = 'Standby';
|
|
521
528
|
elements.gameLayout.appendChild(elements.stepCounter);
|
|
529
|
+
|
|
530
|
+
elements.handCounter = document.createElement('div');
|
|
531
|
+
elements.handCounter.className = 'hand-counter';
|
|
532
|
+
elements.handCounter.textContent = '';
|
|
533
|
+
elements.gameLayout.appendChild(elements.handCounter);
|
|
534
|
+
|
|
522
535
|
return true;
|
|
523
536
|
}
|
|
524
537
|
|
|
@@ -531,7 +544,7 @@ export function renderer(options) {
|
|
|
531
544
|
players: [],
|
|
532
545
|
communityCards: [],
|
|
533
546
|
pot: 0,
|
|
534
|
-
isTerminal: false
|
|
547
|
+
isTerminal: false
|
|
535
548
|
};
|
|
536
549
|
|
|
537
550
|
// --- Step Validation ---
|
|
@@ -539,7 +552,6 @@ export function renderer(options) {
|
|
|
539
552
|
return defaultStateUiData;
|
|
540
553
|
}
|
|
541
554
|
|
|
542
|
-
|
|
543
555
|
return getPokerStateForStep(environment, step);
|
|
544
556
|
}
|
|
545
557
|
|
|
@@ -561,13 +573,18 @@ export function renderer(options) {
|
|
|
561
573
|
|
|
562
574
|
function _renderPokerTableUI(data) {
|
|
563
575
|
if (!elements.pokerTable || !data) return;
|
|
564
|
-
const { players, communityCards, pot, isTerminal, step } = data;
|
|
576
|
+
const { players, communityCards, pot, isTerminal, step, handCount } = data;
|
|
565
577
|
|
|
566
578
|
// Update step counter
|
|
567
579
|
if (elements.stepCounter && step !== undefined) {
|
|
568
580
|
elements.stepCounter.textContent = `Debug Step: ${step}`;
|
|
569
581
|
}
|
|
570
582
|
|
|
583
|
+
// Update hand counter
|
|
584
|
+
if (elements.handCounter && handCount !== undefined) {
|
|
585
|
+
elements.handCounter.textContent = `Hand ${handCount + 1}/100`; // 1-index hands
|
|
586
|
+
}
|
|
587
|
+
|
|
571
588
|
if (elements.diagnosticHeader && data.rawObservation) {
|
|
572
589
|
// Optional: Show diagnostics for debugging
|
|
573
590
|
// elements.diagnosticHeader.textContent = `[${passedOptions.step}] P_TURN:${data.rawObservation.current_player} POT:${data.pot}`;
|
|
@@ -580,10 +597,6 @@ export function renderer(options) {
|
|
|
580
597
|
const numCommunityCards = 5;
|
|
581
598
|
const numCards = communityCards ? communityCards.length : 0;
|
|
582
599
|
|
|
583
|
-
// Since the 4th and 5th street cards are appended to the communityCards array, we need to
|
|
584
|
-
// reverse it so that the added cards are put at the end of the display area on the board.
|
|
585
|
-
if (communityCards) communityCards.reverse();
|
|
586
|
-
|
|
587
600
|
// Add actual cards
|
|
588
601
|
for (let i = 0; i < numCards; i++) {
|
|
589
602
|
elements.communityCardsContainer.appendChild(createCardElement(communityCards[i]));
|
|
@@ -711,7 +724,6 @@ export function renderer(options) {
|
|
|
711
724
|
const uiData = _parseKagglePokerState(options);
|
|
712
725
|
_renderPokerTableUI(uiData, options);
|
|
713
726
|
|
|
714
|
-
|
|
715
727
|
// Apply initial scale
|
|
716
728
|
_applyScale(parent);
|
|
717
729
|
|
|
@@ -195,8 +195,8 @@ kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/
|
|
|
195
195
|
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/vite.config.ts,sha256=KhIjUn0WWhaoQzQ5YKuWjNndimRF0kFlYDgEnZ0cg7U,208
|
|
196
196
|
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/replays/test-replay.json,sha256=jf4ilR6SmOYPNohkIGJvmKP5Gju5FY6sfSStX1qtFZg,28919900
|
|
197
197
|
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/main.ts,sha256=Its2m61qv7RHlHUzIW6JkmySaHWq1h2bJ5sWY9woots,1000
|
|
198
|
-
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/repeated_poker_renderer.js,sha256=
|
|
199
|
-
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/components/getRepeatedPokerStateForStep.js,sha256=
|
|
198
|
+
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/repeated_poker_renderer.js,sha256=wk0wNbShgvjbW_GvgfsffgKzM-HcVKR20xy1lBe89nk,26869
|
|
199
|
+
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/components/getRepeatedPokerStateForStep.js,sha256=KptaJnO6_Duos_TbaKHmeWNyNzzaIKyREdzOTmF34wc,5486
|
|
200
200
|
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/components/utils.js,sha256=pXDAu4V2OppRCvMdJKQ56q1uFTJReMPIvBL6gwxIJoI,5734
|
|
201
201
|
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/images/poker_chip_1.svg,sha256=v9yCvpnaQAg8OSUJdJ5PhuTHm9_zXnww-9_7oR_DJpc,22160
|
|
202
202
|
kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/images/poker_chip_10.svg,sha256=z3CP2h5eUGlgBdqNoWGcioekAyPgiuzhyRNr-nbutOE,22160
|
|
@@ -279,8 +279,8 @@ kaggle_environments/envs/werewolf/scripts/configs/run/rule_experiment/standard_p
|
|
|
279
279
|
kaggle_environments/envs/werewolf/scripts/configs/run/rule_experiment/standard_parallel_voting_no_tie_exile.yaml,sha256=sfSFlFU4F7doZ-wXUWBl-JgJtmpjrLR-SpCAqKnUYeQ,3662
|
|
280
280
|
kaggle_environments/envs/werewolf/scripts/configs/run/rule_experiment/standard_parallel_voting_roundbiddiscussion.yaml,sha256=UGSLfOhmC-4pRqWsJvOtZRU0YLUuOMAGeEHtxTf3wf8,3710
|
|
281
281
|
kaggle_environments/static/player.html,sha256=Icl5yYscPe4BRoWt0HLOSRJWnznQq2MdTHHCaC2OrQQ,27753
|
|
282
|
-
kaggle_environments-1.23.
|
|
283
|
-
kaggle_environments-1.23.
|
|
284
|
-
kaggle_environments-1.23.
|
|
285
|
-
kaggle_environments-1.23.
|
|
286
|
-
kaggle_environments-1.23.
|
|
282
|
+
kaggle_environments-1.23.11.dist-info/entry_points.txt,sha256=h03sq76TdcHvXKcsre1Qm3lIni9dkWehu61xJqI-p8k,69
|
|
283
|
+
kaggle_environments-1.23.11.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
284
|
+
kaggle_environments-1.23.11.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
285
|
+
kaggle_environments-1.23.11.dist-info/METADATA,sha256=rxPlCiReE5xmGogm8qzn2F4qoaVuIjc3CyuhhDKxnZ8,917
|
|
286
|
+
kaggle_environments-1.23.11.dist-info/RECORD,,
|
|
File without changes
|
{kaggle_environments-1.23.10.dist-info → kaggle_environments-1.23.11.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{kaggle_environments-1.23.10.dist-info → kaggle_environments-1.23.11.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|