You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran pip install pybaseball and was attempting to use the season_game_logs function in the retrosheets.py file and realized it wasn't working. I dove into the code and fixed some stuff with the intention of submitting a pull request. Here is the function season_game_logs that was pip installed:
defseason_game_logs(season):
""" Pull Retrosheet game logs for a given season """GH_TOKEN=os.getenv('GH_TOKEN', '')
# validate inputg=Github(GH_TOKEN)
repo=g.get_repo('chadwickbureau/retrosheet')
gamelogs= [f.path[f.path.rfind('/')+1:] forfinrepo.get_contents('gamelog')]
file_name=f'GL{season}.TXT'iffile_namenotingamelogs:
raiseValueError(f'Season game logs not available for {season}')
s=get_text_file(gamelog_url.format(season))
data=pd.read_csv(StringIO(s), header=None, sep=',', quotechar='"')
data.columns=gamelog_columnsreturndata
After "fixing" the code and following the contribution markdown, I realized that the problem had already been fixed on the master branch. So I deleted the pip installed pybaseball code and ran pip install git+ssh://[email protected]/jldbc/pybaseball.git. The code for season_game_logs is:
defseason_game_logs(season):
""" Pull Retrosheet game logs for a given season """GH_TOKEN=os.getenv('GH_TOKEN', '')
# validate inputg=Github(GH_TOKEN)
repo=g.get_repo('chadwickbureau/retrosheet')
season_folder= [f.path[f.path.rfind('/')+1:] forfinrepo.get_contents(f'seasons/{season}')]
gamelog_file_name=f'GL{season}.TXT'ifgamelog_file_namenotinseason_folder:
raiseValueError(f'Season game logs not available for {season}')
s=get_text_file(season_gamelog_url.format(season, season))
data=pd.read_csv(StringIO(s), header=None, sep=',', quotechar='"')
data.columns=gamelog_columnsreturndata
The above seems to be the correct code but this code doesn't get installed when you run pip install pybaseball. I assume this has something to do with the setup.py file, but I'm not exactly sure what needs to change in it.
The text was updated successfully, but these errors were encountered:
The current version on PYPI is 2.2.7 which was released on 2023/09/08. Might need to wait the maintainer to release the latest version of the code.
ref: https://github.com/jldbc/pybaseball/releases
I think the temporary solution is using pip install git+ssh://[email protected]/jldbc/pybaseball.git to install first
I ran
pip install pybaseball
and was attempting to use theseason_game_logs
function in theretrosheets.py
file and realized it wasn't working. I dove into the code and fixed some stuff with the intention of submitting a pull request. Here is the functionseason_game_logs
that was pip installed:After "fixing" the code and following the contribution markdown, I realized that the problem had already been fixed on the master branch. So I deleted the pip installed pybaseball code and ran
pip install git+ssh://[email protected]/jldbc/pybaseball.git
. The code forseason_game_logs
is:The above seems to be the correct code but this code doesn't get installed when you run
pip install pybaseball
. I assume this has something to do with thesetup.py
file, but I'm not exactly sure what needs to change in it.The text was updated successfully, but these errors were encountered: