Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retrosheet.py returns an error for all functions #414

Open
grantdanielson opened this issue Apr 3, 2024 · 1 comment
Open

retrosheet.py returns an error for all functions #414

grantdanielson opened this issue Apr 3, 2024 · 1 comment

Comments

@grantdanielson
Copy link
Contributor

The Chadwick Baseball Bureau seems to have reorganized their enhanced retrosheet repo. This means some modifications need to be made to retrosheet.py.

Here are the errors for each function:

events('2023')
  File "...\pybaseball\retrosheet.py", line 130, in events
    subtree = repo.get_git_tree(subtree.sha)
                                ^^^^^^^
UnboundLocalError: cannot access local variable 'subtree' where it is not associated with a value
rosters('2023')
  File "...\pybaseball\retrosheet.py", line 164, in rosters
    rosters = [t.path for t in repo.get_git_tree(subtree.sha).tree if str(season) in t.path]
                                                 ^^^^^^^
UnboundLocalError: cannot access local variable 'subtree' where it is not associated with a value
park_codes()
  File "...\pybaseball\retrosheet.py", line 213, in park_codes
    data.columns = parkcode_columns
    ^^^^^^^^^^^^
TypeError: park_codes() takes 0 positional arguments but 1 was given
schedules('2023'
  File "...\pybaseball\retrosheet.py", line 224, in schedules
    schedules = [f.path[f.path.rfind('/')+1:] for f in repo.get_contents('schedule')]
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
season_game_logs('2023')
  File "...\pybaseball\retrosheet.py", line 246, in season_game_logs
    raise ValueError(f'Season game logs not available for {season}')
ValueError: Season game logs not available for 2023

world_series_logs(), all_star_game_logs(), wild_card_logs(), division_series_logs(), division_series_logs(), and lcs_logs() all do not have any output in the terminal and no files are created.

@grantdanielson
Copy link
Contributor Author

All retrosheet functions should work now

@grantdanielson grantdanielson changed the title retrosheety.py returns an error for all functions retrosheet.py returns an error for all functions Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant