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 standings_weekly method Football League Class #513

Closed
wants to merge 1 commit into from

Conversation

brthurr
Copy link

@brthurr brthurr commented Dec 11, 2023

Method of the Football League class that will return a list of teams in the order of their standing for a current week. The method calculates the number of wins, losses, points for and points against from week 1 to the provided week. If no week is provided, it will calculate to the league.current_week.

Included test for the method as well.

@brthurr
Copy link
Author

brthurr commented Dec 14, 2023

I have a question that may kill this PR.

Any way of knowing if ESPN calculates points for and points against in real-time? For example, If I run standings on a Sunday at 3PM, will it return PF and PA up to 3 PM, taking into account the noon games that have already been played? Or does it wait for a weekly final, and it only will return PF and PA for the previous full week.

I want to test but won't be able to do so until Thursday when they actually play a game.

@DesiPilla
Copy link
Contributor

DesiPilla commented Dec 14, 2023

@brthurr

I have a question that may kill this PR.

Any way of knowing if ESPN calculates points for and points against in real-time? For example, If I run standings on a Sunday at 3PM, will it return PF and PA up to 3 PM, taking into account the noon games that have already been played? Or does it wait for a weekly final, and it only will return PF and PA for the previous full week.

I want to test but won't be able to do so until Thursday when they actually play a game.

It depends on how you mean points_for. The object team.scores is updated live. But the team.points_for object I'm pretty sure is not live (since the league standings displayed on the site doesn't update until the week is over).

Do you want it to be live? Or do you want something static?

@brthurr
Copy link
Author

brthurr commented Dec 15, 2023

For my purposes, I want it to be static. I'm using it to determine standings at the end of the regular season (for our league, week 14) in order to populate my customer "losers bracket". I have code in my app that already determines if league.current_week is > 14. I was looking at this from the perspective of others who may want to use this method.

@DesiPilla
Copy link
Contributor

@brthurr the tiebreaking process is quite complicated, but I took a stab at it here.

@cwendt94
Copy link
Owner

@brthurr does @DesiPilla PR look to solve the weekly standings? If so we can close this one.

@brthurr
Copy link
Author

brthurr commented Dec 26, 2023

@cwendt94, yep, this looks great! Thanks for the hard work, @DesiPilla! Closing PR.

@brthurr brthurr closed this Dec 26, 2023
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