Skip to content

retrosheet.py returns an error for all functions #414

Open

Description

@grantdanielson

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.

Activity

  1. grantdanielson commented on Apr 4, 2024

    @grantdanielson
    ContributorAuthor

    All retrosheet functions should work now

  2. changed the title [-]retrosheety.py returns an error for all functions[/-] [+]retrosheet.py returns an error for all functions[/+] on Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions