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

Adding a progress bar to reading data. #618

Merged
merged 4 commits into from
Jun 4, 2016
Merged

Adding a progress bar to reading data. #618

merged 4 commits into from
Jun 4, 2016

Conversation

drvinceknight
Copy link
Member

Closes #617

  • 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).

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:

- 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):
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup.

@marcharper
Copy link
Member

Looks good, I just had a couple of minor comments.

@drvinceknight
Copy link
Member Author

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.
@drvinceknight
Copy link
Member Author

I seem to have found an error, it's not quite behaving as it's supposed to. Don't merge just yet :)

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).

@meatballs meatballs merged commit 7eae159 into master Jun 4, 2016
@meatballs meatballs deleted the 617 branch June 4, 2016 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants