Skip to content

Commit

Permalink
Major overhaul to stats system
Browse files Browse the repository at this point in the history
Creates stats object for both player and team stats
One single player object is used for both batters and pitchers
Documentation for individual classes is improved
Removed statmap module
  • Loading branch information
panzarino committed Aug 21, 2017
1 parent f51be65 commit 20d7438
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 436 deletions.
5 changes: 2 additions & 3 deletions mlbgame/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,14 @@ def player_stats(game_id):
"""Return dictionary of player stats for game matching the game id."""
# get information for that game
data = mlbgame.stats.player_stats(game_id)
return mlbgame.stats.Stats(data, game_id)
return mlbgame.stats.Stats(data, game_id, True)


def team_stats(game_id):
"""Return dictionary of team stats for game matching the game id."""
# get data
data = mlbgame.stats.team_stats(game_id)
output = {x: mlbgame.stats.TeamStats(data[x]) for x in data}
return output
return mlbgame.stats.Stats(data, game_id, False)


def combine_stats(stats):
Expand Down
Loading

0 comments on commit 20d7438

Please sign in to comment.