-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: HDFStore __unicode__ method #16514
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
Conversation
pandas/io/pytables.py
Outdated
@@ -1161,6 +1136,35 @@ def copy(self, file, mode='w', propindexes=True, keys=None, complib=None, | |||
|
|||
return new_store | |||
|
|||
def info(self): | |||
"""return detailed information on the store""" |
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.
add a versionadded tag.
doc/source/whatsnew/v0.21.0.txt
Outdated
@@ -75,7 +75,7 @@ Removal of prior version deprecations/changes | |||
|
|||
Performance Improvements | |||
~~~~~~~~~~~~~~~~~~~~~~~~ | |||
|
|||
- :class:`pandas.HDFStore`'s string representation is now faster and less detailed. For the previous behavior, use ``pandas.HDFStore.info()``. (:issue:`16503`). |
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.
move to API breaking changes
pandas/io/pytables.py
Outdated
def info(self): | ||
"""return detailed information on the store""" | ||
output = '%s\nFile path: %s\n' % (type(self), pprint_thing(self._path)) | ||
if self.is_open: |
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.
add this to api.rst
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.
lgtm, with some minor comment.
ping when fixed / green. |
Codecov Report
@@ Coverage Diff @@
## master #16514 +/- ##
==========================================
- Coverage 90.79% 90.79% -0.01%
==========================================
Files 161 161
Lines 51063 51065 +2
==========================================
Hits 46365 46365
- Misses 4698 4700 +2
Continue to review full report at Codecov.
|
|
f5dd983
to
97eaae3
Compare
@jreback I think this is ready to go? |
@@ -4371,11 +4373,11 @@ def test_multiple_open_close(self): | |||
|
|||
# single | |||
store = HDFStore(path) | |||
assert 'CLOSED' not in str(store) | |||
assert 'CLOSED' not in store.info() |
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.
so you should also test str(store) a bit (u changed all of these to .info())
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.
I added a test that str(store) prints the filename, is that what you mean? There's not much behavior in there anymore to test...
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.
point to it it's not clear where it is
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.
…avior. __unicode__ now only returns file path info, not (expensive) details on all existing keys.
@Kiv Some timing info in the PR would be useful for future reference. Plus a benchmark test would be good here. |
@Kiv lgtm. if you would add an asv would be great (you can use your original example, just not as long, maybe 20 nodes or something would be fine). |
can you add an asv? |
* ENH pandas-dev#15972 added margins_name parameter for crosstab * ENH 15972 minor changes as suggested by reviewers * ENH 15972 correction in whatsnew * ENH 15972 style changes in whatsnew
Replaces most uses of implicit global state from matplotlib in test_datetimelike.py. This was potentially causing random failures where a figure expected to be on a new, blank figure would instead plot on an existing axes (that's the guess at least).
* DOC: change doc build to python 3.6 * Remove pinning of pyqt to 4.x * Remove pinning of openpyxl * Add xsel to doc build for clipboard
* PERF: vectorize _interp_limit * CLN: remove old implementation * fixup! CLN: remove old implementation
…ndas-dev#16444) * BUG: Handle numpy strings in index names in HDF5 pandas-dev#13492 * REF: refactor to _ensure_str
…ches (pandas-dev#16460) * pandas-devgh-14671 Check if usecols with type string contains a subset of names, if not throws an error * tests added for pandas-devgh-14671, expected behavior of simultaneous use of usecols and names unclear so these tests are commented out * Review comments
Splits extra information about the license and copyright holders to AUTHORS.md.
* COMPAT: numpy 1.13 test compat * CI: fix doc build to 1.12
)" (pandas-dev#16657) This reverts commit ec6bf6d. 1.17.1 released that fixes
My git branch got out of date and I don't know how to update it properly. New version with ASV bench is here: |
in the future see: http://pandas.pydata.org/pandas-docs/stable/contributing.html#combining-commits. Much much better to push to the same PR. opening new ones is rarely needed (for the same issue) you just needed to do:
|
HDFStore unicode now only returns file path info. New info() method has the previous behavior of unicode.
git diff upstream/master --name-only -- '*.py' | flake8 --diff