- test_game_data.py: Static lineup data based on real SBA Game 2519 - West Virginia Black Bears vs Columbus Hydra - Complete lineup data with player info - create_test_game.py: Script to end active games and create fresh test game - Usage: uv run python scripts/create_test_game.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
101 lines
3.4 KiB
Python
101 lines
3.4 KiB
Python
"""
|
|
Test Game Data - Static lineup data for test game creation.
|
|
|
|
Based on SBA Game 2519 (Season 12, Week 1):
|
|
- West Virginia Black Bears (499) vs Columbus Hydra (544)
|
|
- Final Score: WV 4 - CLS 3
|
|
|
|
Author: Claude
|
|
Date: 2025-01-10
|
|
"""
|
|
|
|
# Team Information
|
|
AWAY_TEAM = {
|
|
"id": 499,
|
|
"abbrev": "WV",
|
|
"short_name": "Black Bears",
|
|
"long_name": "West Virginia Black Bears",
|
|
"manager_id": 3,
|
|
"manager_name": "Cal",
|
|
}
|
|
|
|
HOME_TEAM = {
|
|
"id": 544,
|
|
"abbrev": "CLS",
|
|
"short_name": "Hydra",
|
|
"long_name": "Columbus Hydra",
|
|
"manager_id": 14,
|
|
"manager_name": "Mason",
|
|
}
|
|
|
|
# Away Team Lineup - West Virginia Black Bears (Team 499)
|
|
# Pitcher: Zac Gallen
|
|
AWAY_LINEUP = [
|
|
# Batters (batting_order 1-9)
|
|
{"player_id": 12288, "name": "Ronald Acuna Jr", "position": "RF", "batting_order": 1},
|
|
{"player_id": 12395, "name": "Trea Turner", "position": "SS", "batting_order": 2},
|
|
{"player_id": 11483, "name": "Alec Burleson", "position": "1B", "batting_order": 3},
|
|
{"player_id": 11487, "name": "Alex Bregman", "position": "3B", "batting_order": 4},
|
|
{"player_id": 12262, "name": "Ramon Urias", "position": "2B", "batting_order": 5},
|
|
{"player_id": 12356, "name": "Steven Kwan", "position": "LF", "batting_order": 6},
|
|
{"player_id": 12339, "name": "Shea Langeliers", "position": "C", "batting_order": 7},
|
|
{"player_id": 11706, "name": "David Fry", "position": "DH", "batting_order": 8},
|
|
{"player_id": 11545, "name": "Blake Perkins", "position": "CF", "batting_order": 9},
|
|
# Starting Pitcher
|
|
{"player_id": 12479, "name": "Zac Gallen", "position": "P", "batting_order": None},
|
|
]
|
|
|
|
# Home Team Lineup - Columbus Hydra (Team 544)
|
|
# Pitcher: Tanner Houck
|
|
HOME_LINEUP = [
|
|
# Batters (batting_order 1-9)
|
|
{"player_id": 12154, "name": "Michael Busch", "position": "2B", "batting_order": 1},
|
|
{"player_id": 12455, "name": "Willy Adames", "position": "SS", "batting_order": 2},
|
|
{"player_id": 12110, "name": "Luke Raley", "position": "LF", "batting_order": 3},
|
|
{"player_id": 12135, "name": "Matt Chapman", "position": "3B", "batting_order": 4},
|
|
{"player_id": 11768, "name": "Eric Haase", "position": "C", "batting_order": 5},
|
|
{"player_id": 11523, "name": "Anthony Santander", "position": "RF", "batting_order": 6},
|
|
{"player_id": 11611, "name": "Cal Raleigh", "position": "DH", "batting_order": 7},
|
|
{"player_id": 12250, "name": "Pete Alonso", "position": "1B", "batting_order": 8},
|
|
{"player_id": 11927, "name": "JJ Bleday", "position": "CF", "batting_order": 9},
|
|
# Starting Pitcher
|
|
{"player_id": 12366, "name": "Tanner Houck", "position": "P", "batting_order": None},
|
|
]
|
|
|
|
|
|
def get_test_game_config() -> dict:
|
|
"""
|
|
Get complete test game configuration.
|
|
|
|
Returns:
|
|
Dictionary with away_team, home_team, away_lineup, home_lineup
|
|
"""
|
|
return {
|
|
"away_team": AWAY_TEAM,
|
|
"home_team": HOME_TEAM,
|
|
"away_lineup": AWAY_LINEUP,
|
|
"home_lineup": HOME_LINEUP,
|
|
"league_id": "sba",
|
|
}
|
|
|
|
|
|
def get_lineup_for_team(team_id: int) -> list[dict]:
|
|
"""
|
|
Get lineup for a specific team.
|
|
|
|
Args:
|
|
team_id: Team identifier (499 or 544)
|
|
|
|
Returns:
|
|
List of player lineup entries
|
|
|
|
Raises:
|
|
ValueError: If team_id is not recognized
|
|
"""
|
|
if team_id == 499:
|
|
return AWAY_LINEUP
|
|
elif team_id == 544:
|
|
return HOME_LINEUP
|
|
else:
|
|
raise ValueError(f"Unknown team_id: {team_id}. Use 499 (WV) or 544 (CLS)")
|