npb_data_app / utils.py
patrickramos's picture
Make pitch stats code resuable for player and team types
33c77d4
raw
history blame contribute delete
359 Bytes
def get_col_width(col, player_team_type):
match col:
case 'Pitcher' | 'Batter':
return 125
case 'Team':
return 75
case 'Throws' | 'Bats':
return 60
case 'IP':
return 60 if player_team_type == 'team pitching' else 50
case 'Pitch' | 'Pitch (General)':
return 125
case _:
return max(50, 10*len(col))