jldbc / pybaseball

Pull current and historical baseball statistics using Python (Statcast, Baseball Reference, FanGraphs)
MIT License
1.19k stars 324 forks source link

Rename teams to teams_core #263

Closed tjburch closed 2 years ago

tjburch commented 2 years ago

251 introduced a bug in __init__.py after updating teams() to teams_core(). This updates the call to the new teams_core().

before:

In [1]: from pybaseball.batting_stats_range import batting_stats_range
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 from pybaseball.league_batting_stats import batting_stats_range

File ~/Documents/github/pybaseball/pybaseball/__init__.py:79, in <module>
     77 from .lahman import schools
     78 from .lahman import series_post
---> 79 from .lahman import teams_core
     80 from .lahman import teams_upstream
     81 from .lahman import teams_franchises

ImportError: cannot import name 'teams_core' from 'pybaseball.lahman' (/Users/tburch/Documents/github/pybaseball/pybaseball/lahman.py)

after:

In [1]: from pybaseball.league_batting_stats import batting_stats_range

In [2]: quit()

I will note that #260 also took care of this, but it's probably preferable to continue with the teams_core name rather than roll back to teams and also segment this out to an independent PR.

My guess is this also covers issue #253.