fix: set lower bound of 1 for games played#661
Open
DesiPilla wants to merge 2 commits intocwendt94:masterfrom
Open
fix: set lower bound of 1 for games played#661DesiPilla wants to merge 2 commits intocwendt94:masterfrom
DesiPilla wants to merge 2 commits intocwendt94:masterfrom
Conversation
If a league has bye weeks, those team's `team.outcomes` will be populated with a `'U'` and not included in the denominator when calculating the win percentage. However, if a team had a bye in week 1, then their total games played will sum to 0 and raise a `ZeroDivisionError: float division by zero`. This bounds the denominator at 1 so that a 0.0 `win_pct` is calculated instead.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #661 +/- ##
==========================================
- Coverage 71.19% 71.13% -0.07%
==========================================
Files 62 62
Lines 2368 2370 +2
==========================================
Hits 1686 1686
- Misses 682 684 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Previously this rule was not handled and would throw an error `Unkown tiebreaker_method: Must be either 'TOTAL_POINTS_SCORED' or 'H2H_RECORD'`
Contributor
Author
|
@cwendt94 Can you take a look at this PR? |
Owner
|
Looks good, just needs to pull the latest changes that have the new tiebreaker rule |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a league has bye weeks, those team's
team.outcomeswill be populated with a'U'and not included in the denominator when calculating the win percentage. However, if a team had a bye in week 1, then their total games played will sum to 0 and raise aZeroDivisionError: float division by zero. This bounds the denominator at 1 so that a 0.0win_pctis calculated instead.