strat-gameplay-webapp/backend/app/config/test_game_data.py
Cal Corum a4b99ee53e CLAUDE: Replace black and flake8 with ruff for formatting and linting
Migrated to ruff for faster, modern code formatting and linting:

Configuration changes:
- pyproject.toml: Added ruff 0.8.6, removed black/flake8
- Configured ruff with black-compatible formatting (88 chars)
- Enabled comprehensive linting rules (pycodestyle, pyflakes, isort,
  pyupgrade, bugbear, comprehensions, simplify, return)
- Updated CLAUDE.md: Changed code quality commands to use ruff

Code improvements (490 auto-fixes):
- Modernized type hints: List[T] → list[T], Dict[K,V] → dict[K,V],
  Optional[T] → T | None
- Sorted all imports (isort integration)
- Removed unused imports
- Fixed whitespace issues
- Reformatted 38 files for consistency

Bug fixes:
- app/core/play_resolver.py: Fixed type hint bug (any → Any)
- tests/unit/core/test_runner_advancement.py: Removed obsolete random mock

Testing:
- All 739 unit tests passing (100%)
- No regressions introduced

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 15:33:21 -06:00

120 lines
3.5 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
if team_id == 544:
return HOME_LINEUP
raise ValueError(f"Unknown team_id: {team_id}. Use 499 (WV) or 544 (CLS)")