cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
613 stars 198 forks source link

feat: Add active status to `Player` #502

Closed DesiPilla closed 10 months ago

DesiPilla commented 10 months ago

This PR can finally resolve a long-standing issue... historical injury status! For a while now, an issue (https://github.com/cwendt94/espn-api/issues/327, https://github.com/cwendt94/espn-api/issues/401) we've had is that ESPN only return's a player's current health status, even when querying a previous week or year. I think I have a way to get around this and assume a player's health status from previous weeks.

This uses the embedded stats objects to decipher whether a player was active in a historical week.

Testing and research can be viewed here.

codecov-commenter commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (cac4300) 80.53% compared to head (3c00fdc) 80.57%. Report is 2 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #502 +/- ## ========================================== + Coverage 80.53% 80.57% +0.04% ========================================== Files 59 59 Lines 2106 2111 +5 ========================================== + Hits 1696 1701 +5 Misses 410 410 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

DesiPilla commented 10 months ago

@cwendt94 I can't quite figure out where/how to add unit tests with your current setup, but I validated this on a variety of cases here.

DesiPilla commented 10 months ago

@cwendt94 Any update on this PR?

cwendt94 commented 10 months ago

Thanks for the bump @DesiPilla and figuring out a work around from ESPNs data. Looks good to me!