Skip to content

Commit

Permalink
Change assumed end of season date from November 1 to November 30 (#323)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Kain <tom.kain@includedhealth.com>
  • Loading branch information
TK2575 and tomkain-ih authored Feb 25, 2023
1 parent fae5466 commit bb000d2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pybaseball/league_batting_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def batting_stats_bref(season: Optional[int] = None) -> pd.DataFrame:
if season is None:
season = most_recent_season()
start_dt = f'{season}-03-01' #opening day is always late march or early april
end_dt = f'{season}-11-01' #season is definitely over by November
end_dt = f'{season}-11-30' #postseason is definitely over by end of November
return batting_stats_range(start_dt, end_dt)


Expand Down
2 changes: 1 addition & 1 deletion pybaseball/league_pitching_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def pitching_stats_bref(season: Optional[int]=None) -> pd.DataFrame:
season = most_recent_season()
str_season = str(season)
start_dt = str_season + '-03-01' #opening day is always late march or early april
end_dt = str_season + '-11-01' #season is definitely over by November
end_dt = str_season + '-11-30' #postseason is definitely over by end of November
return(pitching_stats_range(start_dt, end_dt))


Expand Down
2 changes: 1 addition & 1 deletion tests/pybaseball/test_league_batting_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def test_batting_stats_bref_none() -> None:
with patch('pybaseball.league_batting_stats.batting_stats_range', batting_stats_range_mock):
league_batting_stats.batting_stats_bref(None)

batting_stats_range_mock.assert_called_once_with(f'{this_year}-03-01', f"{this_year}-11-01")
batting_stats_range_mock.assert_called_once_with(f'{this_year}-03-01', f"{this_year}-11-30")
2 changes: 1 addition & 1 deletion tests/pybaseball/test_league_pitching_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def test_pitching_stats_bref_none() -> None:
with patch('pybaseball.league_pitching_stats.pitching_stats_range', pitching_stats_range_mock):
league_pitching_stats.pitching_stats_bref(None)

pitching_stats_range_mock.assert_called_once_with(f'{this_year}-03-01', f"{this_year}-11-01")
pitching_stats_range_mock.assert_called_once_with(f'{this_year}-03-01', f"{this_year}-11-30")

0 comments on commit bb000d2

Please sign in to comment.