-
Notifications
You must be signed in to change notification settings - Fork 263
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
Adding a progress bar to reading data. #618
Conversation
- Done by keeping track of the interactions in the tournament and passing this to the ResultSetFromFile. - If this is created by directly reading from file (so that we do not know how many rows of data there are) then a quick count of the size of the file is done (this is slightly inefficient but is worth it as it gives some user feedback).
@@ -707,16 +707,23 @@ class ResultSetFromFile(ResultSet): | |||
by the tournament class. | |||
""" | |||
|
|||
def __init__(self, filename, progress_bar=True): | |||
def __init__(self, filename, progress_bar=True, | |||
num_interactions=False): |
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.
None
instead of False
makes more sense?
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.
Yup.
Looks good, I just had a couple of minor comments. |
I seem to have found an error, it's not quite behaving as it's supposed to. Don't merge just yet :) |
Was counting the number of interactions twice for serial play. This fixes it.
c420b54 fixes it. This is good to go. Reapplying your 1-positive-review label @marcharper (took it off just to make sure this wouldn't be merged whilst I did the one line fix). |
Closes #617
passing this to the ResultSetFromFile.
know how many rows of data there are) then a quick count of
the size of the file is done (this is slightly inefficient but is
worth it as it gives some user feedback).
Here's a gif of it reading in the file when it's not given the size of the file (there's a small delay as it counts the size of the file):
Here's a gif of it reading it in when it's given the size of the file:
We can also call it with
progress_bar=False
: