Skip to content

Doc for HDFStore compression unclear on what the default value of None does #26139

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

Closed
chrish42 opened this issue Apr 18, 2019 · 2 comments · Fixed by #26158
Closed

Doc for HDFStore compression unclear on what the default value of None does #26139

chrish42 opened this issue Apr 18, 2019 · 2 comments · Fixed by #26158
Labels
Docs IO HDF5 read_hdf, HDFStore
Milestone

Comments

@chrish42
Copy link
Contributor

The doc for the HDFStore class mentions:

complevel : int, 0-9, default None
            Specifies a compression level for data.
            A value of 0 disables compression.

That doesn't actually answer the question of what compression level is used when the default (None) is used, though. Is None translated further down to 0? it turns out yes, but you have to dig in the code to actually figure that out. And it could as well have been translated eventually to any other value.

Two options:

  1. Actually change the default in the complevel argument to be "0". (It's an immutable object, so it's fine as a default value for a function argument.)
  2. Just adjust the doc in some way.

When the right solution is decided, I can do a pull request with it. Thanks!

@WillAyd WillAyd added the Docs label Apr 18, 2019
@WillAyd
Copy link
Member

WillAyd commented Apr 18, 2019

I think either option would be fine

@WillAyd WillAyd added this to the Contributions Welcome milestone Apr 18, 2019
@swyoon
Copy link
Contributor

swyoon commented Apr 20, 2019

It seems like complevel=None is translated into 0. I will add this to the docstring.

self._complevel = complevel if complevel else 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs IO HDF5 read_hdf, HDFStore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants