Skip to content

Use scandir in DirectoryStore.getsize #431

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

Merged
merged 8 commits into from
Apr 30, 2019
Merged

Use scandir in DirectoryStore.getsize #431

merged 8 commits into from
Apr 30, 2019

Conversation

jakirkham
Copy link
Member

@jakirkham jakirkham commented Apr 21, 2019

Changes the DirectoryStore.getsize implementation to use scandir. This is significantly faster than just using listdir (especially as we are checking whether the item is a file and what it's size is). This is included in Python 3.5+. For older versions of Python we require the scandir package from PyPI.

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/tutorial.rst
  • Changes documented in docs/release.rst
  • Docs build locally (e.g., run tox -e docs)
  • AppVeyor and Travis CI passes
  • Test coverage is 100% (Coveralls passes)

jakirkham and others added 4 commits April 21, 2019 00:07
As `scandir` was added to the `os` module in Python 3.5, require the
backport package for `scandir` is installed for versions prior to
that (e.g. Python 2.7).
@jakirkham
Copy link
Member Author

Thoughts @zarr-developers/core-devs ?

@shikharsg
Copy link
Contributor

lgtm

@mzjp2
Copy link
Member

mzjp2 commented Apr 24, 2019

Agreed, looks good.

@jakirkham jakirkham merged commit 3ace301 into zarr-developers:master Apr 30, 2019
@jakirkham jakirkham deleted the use_scandir_getsize branch April 30, 2019 23:53
@joshmoore joshmoore mentioned this pull request Feb 18, 2021
7 tasks
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