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

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

Merged
merged 12 commits into from Dec 21, 2023

Conversation

DesiPilla
Copy link
Contributor

@DesiPilla DesiPilla commented Dec 16, 2023

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.

Subject to the league's specific tiebreaker rules
I'm used to always having `pandas` and `numpy` available, made that change now.
@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2023

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 ⚠️
espn_api/football/league.py 87.50% 3 Missing ⚠️

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

Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DesiPilla
Copy link
Contributor Author

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

Now explicitly tests for the exact standings of the test league
@cwendt94
Copy link
Owner

@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
Copy link
Contributor Author

@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
Copy link
Owner

Thank you, this is looking good!

@DesiPilla
Copy link
Contributor Author

@cwendt94 alright the coverage should be good now.

@cwendt94
Copy link
Owner

@DesiPilla great work and thanks for adding the coverage!

@cwendt94 cwendt94 merged commit 15094e4 into cwendt94:master Dec 21, 2023
3 checks passed
@DesiPilla DesiPilla deleted the historical-standings branch December 21, 2023 20:55
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

Successfully merging this pull request may close these issues.

None yet

3 participants