Skip to content

Commit

Permalink
Merge pull request #198 from cwendt94/FixBaseballStatMatching
Browse files Browse the repository at this point in the history
Baseball Remove stat from team/matchup
  • Loading branch information
cwendt94 authored Apr 7, 2021
2 parents fdfda7c + cbf836e commit 7592aa2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
9 changes: 0 additions & 9 deletions espn_api/baseball/matchup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def _fetch_matchup_info(self, data):
self.away_team = data['away']['teamId']
self.away_final_score = data['away']['totalPoints']
self.winner = data['winner']
self.home_team_cats = None
self.away_team_cats = None

# if stats are available
if 'cumulativeScore' in data['home'].keys() and data['home']['cumulativeScore']['scoreByStat']:
Expand All @@ -38,10 +36,3 @@ def _fetch_matchup_info(self, data):
data['home']['cumulativeScore']['ties']/2)
self.away_team_live_score = (data['away']['cumulativeScore']['wins'] +
data['away']['cumulativeScore']['ties']/2)

self.home_team_cats = { STATS_MAP[i]: {'score': data['home']['cumulativeScore']['scoreByStat'][i]['score'],
'result': data['home']['cumulativeScore']['scoreByStat'][i]['result']} for i in data['home']['cumulativeScore']['scoreByStat'].keys()}

self.away_team_cats = { STATS_MAP[i]: {'score': data['away']['cumulativeScore']['scoreByStat'][i]['score'],
'result': data['away']['cumulativeScore']['scoreByStat'][i]['result']} for i in data['away']['cumulativeScore']['scoreByStat'].keys()}

3 changes: 0 additions & 3 deletions espn_api/baseball/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ def __init__(self, data, member, roster, schedule, year):
self.ties = data['record']['overall']['ties']
self.owner = 'None'
self.logo_url = ''
self.stats = None
self.standing = data['playoffSeed']
self.final_standing = data['rankCalculatedFinal']
self.roster = []
self.schedule = []

if 'valuesByStat' in data:
self.stats = {STATS_MAP[i]: j for i, j in data['valuesByStat'].items()}
if member:
self.owner = "%s %s" % (member['firstName'],
member['lastName'])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name='espn_api',
packages=find_packages(),
version='0.14.0',
version='0.14.1',
author='Christian Wendt',
description='ESPN API',
install_requires=['requests>=2.0.0,<3.0.0', 'pandas>=0.11.0,<=0.25.3', 'numpy>=1.15,<=1.17.0'],
Expand Down

0 comments on commit 7592aa2

Please sign in to comment.