Skip to content

Commit

Permalink
Fixed issue with scores. Accidently added current goal as part of the…
Browse files Browse the repository at this point in the history
… score for the player
  • Loading branch information
HarryShomer committed Jan 20, 2019
1 parent 3014890 commit a8a4f0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions hockey_scraper/html_pbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ def add_score(event_dict, event, current_score, home_team):
:return: None
"""
event_dict['Home_Score'] = current_score['Home']
event_dict['Away_Score'] = current_score['Away']
event_dict['score_diff'] = current_score['Home'] - current_score['Away']

# If it's a goal change the score
if event[4] == 'GOAL':
Expand All @@ -304,10 +307,6 @@ def add_score(event_dict, event, current_score, home_team):
else:
current_score['Away'] += 1

event_dict['Home_Score'] = current_score['Home']
event_dict['Away_Score'] = current_score['Away']
event_dict['score_diff'] = current_score['Home'] - current_score['Away']


def get_penalty(play_description, players, home_team):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def read():

setup(
name='hockey_scraper',
version='1.3.2.5',
version='1.3.3',
description="""This package is designed to allow one to scrape the raw data for both the National Hockey League
(NHL) and the National Women's Hockey League (NWHL) off of their respective API and websites. For the
NHL it allows one to scrape the Play by Play and Shift data since the 2007-2008 season. For the
Expand Down

0 comments on commit a8a4f0d

Please sign in to comment.