Skip to content

Commit

Permalink
Fixed bug in is_team_home, failed if team doesn't have playoffs
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoBarbieri committed Jul 16, 2024
1 parent 788e97f commit bab29c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nba_api/deployment/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.2.1
4 changes: 3 additions & 1 deletion nba_api/featurevec/feature_vector_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ def is_team_home(team_ticker: str, game_id: str, season: str) -> bool:
:return: A boolean representing if the team is the home team.
"""
team_game_log = get_season_games_for_team(team_ticker, season, False)
team_game_log.extend(get_season_games_for_team(team_ticker, season, True))
if playoffs := get_season_games_for_team(team_ticker, season, True):
team_game_log.extend(playoffs)

for game in team_game_log:
if game['game_id'] == game_id:
return get_home_away_team(game['matchup'])['home_team'] == team_ticker
Expand Down

0 comments on commit bab29c6

Please sign in to comment.