Skip to content

Report how many keys need to be populated#274

Merged
dimitri-yatsenko merged 4 commits intodatajoint:masterfrom
eywalker:master
Dec 20, 2016
Merged

Report how many keys need to be populated#274
dimitri-yatsenko merged 4 commits intodatajoint:masterfrom
eywalker:master

Conversation

@eywalker
Copy link
Contributor

Unlike in Matlab, populate does not report how many keys still have to be populated at the beginning of the populate invocation. This information is a useful quick indicator.

@coveralls
Copy link

coveralls commented Dec 20, 2016

Coverage Status

Coverage increased (+0.004%) to 93.568% when pulling 08404bf on eywalker:master into c03a24a on datajoint:master.

keys = list(keys)
random.shuffle(keys)

logger.info('Found %d keys to populate' % len(todo))
Copy link
Member

@dimitri-yatsenko dimitri-yatsenko Dec 20, 2016

Choose a reason for hiding this comment

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

len(todo) is an extra query, which may take some time. Would you extract the length from keys instead? This will require converting the iterator into a list, but it's a small cost compared to an extra query.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes made.

@coveralls
Copy link

coveralls commented Dec 20, 2016

Coverage Status

Coverage increased (+0.1%) to 93.671% when pulling b93da08 on eywalker:master into c03a24a on datajoint:master.

@dimitri-yatsenko dimitri-yatsenko merged commit 69b43b4 into datajoint:master Dec 20, 2016
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.

3 participants