Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ampling Backend: - Sample a concrete court zone for each simulated field goal from the player's real shot chart (TendencyProfile.shot_zone_weights), falling back to a disclosed league-average split for pre-tracking seasons; consumes no RNG when absent so seeded games stay byte-identical. - Add a model-derived win-probability curve per game: an absorbing-barrier Markov chain over (score_a, score_b, possession) using each player's tendency profile, pinned to 1/0 only once a player reaches 21. Frontend: - Replace the tip-off overlay + collapsible play-by-play with an inline BroadcastStrip: live floor playback, scoreboard, odds graph, shot-chart comparison, and the running wire feed, scrolled into view on each run. - Extract shared court geometry (lib/court), live-game helpers (lib/liveGame), shot-efficiency color ramp (lib/shotEfficiency), and the useLiveGame hook. - Pin the head-to-head comparison panel to the bottom of the page. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Turns the single-game simulator into a live broadcast experience and makes the simulation richer with real shot placement and a model-derived win-probability curve.
Backend (
simulation.py,tendency_profile.py)shot_zone_basic/shot_zone_area) sampled from the player's real shot chart (TendencyProfile.shot_zone_weights). Pre-tracking seasons / players with no observed chart fall back to a disclosed league-average split. Consumes no RNG when no zones exist, so seeded games stay byte-identical.win_probabilityper game — an absorbing-barrier Markov chain over(score_a, score_b, possession)whose per-possession distributions come from each player's tendency profile. Pinned to 1.0/0.0 only once a player actually reaches 21 (no premature certainty).Frontend
BroadcastStripreplaces the tip-off overlay + collapsible play-by-play: live floor playback, scoreboard, odds graph, final shot-chart comparison, and the running wire feed — scrolled into view on each run.lib/court(court geometry),lib/liveGame(enrich/resolve/format helpers),lib/shotEfficiency(FG% color ramp + zone grading), and theuseLiveGamehook.Testing
pytest backend/tests/test_simulation.py backend/tests/test_tendency_profile.py— 38 passednpx tsc -b --noEmit— cleanReview notes
A
/code-reviewpass surfaced a few follow-ups worth tracking (not blocking this PR):_simulate_possession(raw vs. capped foul rate; foul not scaled by(1 - turnover)).efficiencyColor/grading helpers still live inShotChartSheet.tsxandSimulator.tsxand could import from the newlib/shotEfficiency.OddsGraphrebuilds its SVG paths every animation frame (could be memoized).🤖 Generated with Claude Code