-
Notifications
You must be signed in to change notification settings - Fork 0
Basic Verification Using Available Offline Data #4
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
Open
ddrobner
wants to merge
17
commits into
master
Choose a base branch
from
basic-verification
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0af543a
Added method to get score from TBA API
ddrobner ae6c524
Removed TBA test file
ddrobner 590069d
Return boolean from verify_score instead of the actual score
ddrobner 1f2b756
Renamed verify to verify_offline to separate the functionality of the…
ddrobner 8cd5fec
Added method to check if score is numeric
ddrobner defcadf
Added comment to remind for later cleanup
ddrobner 6b59804
^^
ddrobner 67fc310
Created constants file
ddrobner 5aeadf8
Added method to check if score is within acceptable bounds
ddrobner fc69da9
Correct wrong comparison in score bounds check
ddrobner 8ba6c1b
Renamed the check for if score is an int
ddrobner 1dab4ad
Added match bounds to constants
ddrobner 745b59e
Added method to check match bounds
ddrobner 0ad1147
Added method to check if match number is numeric
ddrobner 390f6b2
Fleshed out verify_offline method
ddrobner 95426b7
Added verification to when the data is written
ddrobner 2d22ceb
Remove unused sys import from Scan.py
ddrobner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| SCORE_MIN = 0 | ||
| SCORE_MAX = 250 | ||
| #TODO determine if match can be numbered 0 | ||
| MATCH_MIN = 1 | ||
| #TODO check if there are any super large events with >200 matches in Q | ||
| MATCH_MAX = 200 |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,37 @@ | ||
| import Constants | ||
|
|
||
| class Verify: | ||
| def __init__(self): | ||
| pass | ||
|
|
||
| def verify(self): | ||
| pass | ||
| #TODO give better name | ||
| def score_isnumeric(self, score): | ||
| # Could use isnumeric() here, but it will throw an error if score is an integer | ||
| try: | ||
| int(score) | ||
| except ValueError: | ||
| return False | ||
| return True | ||
|
|
||
| def check_score_bounds(self, score): | ||
| if (Constants.SCORE_MIN > score) or (Constants.SCORE_MAX < score): | ||
| return False | ||
| return True | ||
|
|
||
| # pretty much just copypaste but it's for readability | ||
| def match_isnumeric(self, matchno): | ||
| try: | ||
| int(match) | ||
| except ValueError: | ||
| return False | ||
| return True | ||
|
|
||
| def check_match_bounds(self, matchno): | ||
| if (Constants.MATCH_MIN > matchno) or (Constants.MATCH_MAX < matchno): | ||
| return False | ||
| return True | ||
|
|
||
| def verify_offline(self, score, matchno): | ||
| if self.score_isnumeric(score) and self.check_score_bounds(score) and self.match_isnumeric(matchno) and self.check_match_bounds(matchno): | ||
| return True | ||
| return False | ||
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
This file was deleted.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return A and B and CUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing generally applies to methods above, too. Just not ones that use exception handling, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thanks for pointing that out, didn't think about using boolean operators in a return.