cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
544 stars 183 forks source link

feat: Add method to calculate historical standings for any week #515

Closed DesiPilla closed 6 months ago

DesiPilla commented 6 months ago

This PR is to replace another attempt.

The tiebreaking process is quite complicated, but this follows all tiebreaking levels, subject to a league's specific tiebreaker rules.

codecov-commenter commented 6 months ago

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (62700b2) 80.60% compared to head (73bab47) 81.03%.

Files Patch % Lines
espn_api/football/helper.py 91.89% 6 Missing :warning:
espn_api/football/league.py 87.50% 3 Missing :warning:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #515 +/- ## ========================================== + Coverage 80.60% 81.03% +0.42% ========================================== Files 59 60 +1 Lines 2114 2209 +95 ========================================== + Hits 1704 1790 +86 - Misses 410 419 +9 ```

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

DesiPilla commented 6 months ago

@cwendt94 looks like we don't have any test leagues that use H2H_RECORD as the tiebreaker, but otherwise this PR is set.

cwendt94 commented 6 months ago

@DesiPilla could you move all of the helper functions in its own file helper.py so that we don't bloat the league object.

DesiPilla commented 6 months ago

@cwendt94 I agree that's the cleaner way to do it. I moved everything over now. I'm making some test cases for the sorting criteria that don't get run by default so that we have better code coverage.

cwendt94 commented 6 months ago

Thank you, this is looking good!

DesiPilla commented 6 months ago

@cwendt94 alright the coverage should be good now.

cwendt94 commented 6 months ago

@DesiPilla great work and thanks for adding the coverage!