-
-
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
Changes from 1 commit
6faa5a6
c8af4cf
840de2f
4ed801b
c570eaf
44d2a12
1a9cb5b
0a9f548
f7149a2
36d6171
ab9bc9a
9a9c315
79cc4a9
0db4de5
c193235
b9febe0
98ed54d
6d761b4
ed542ee
f92ec38
3f70fda
785887a
746c3cb
885522a
79beeb6
a7c95f2
50479ae
b8ca9fc
e331c78
e24e57c
ec535e9
9e71f08
32512b9
36670fc
5d7a020
882ea0f
9d0be9d
b3769f1
a0174eb
9771514
cf5f2d8
1415b95
93aabe7
3ebd719
fd171eb
4b0ef03
1b159af
8eb0c7f
6fa83d3
aba51b6
fdb54df
41b3968
9d4c88d
8f6e50a
1de16b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,6 +387,7 @@ def test_repr(self): | |
|
||
with ensure_clean_store(self.path) as store: | ||
repr(store) | ||
store.info() | ||
store['a'] = tm.makeTimeSeries() | ||
store['b'] = tm.makeStringSeries() | ||
store['c'] = tm.makeDataFrame() | ||
|
@@ -418,8 +419,9 @@ def test_repr(self): | |
# make a random group in hdf space | ||
store._handle.create_group(store._handle.root, 'bah') | ||
|
||
repr(store) | ||
str(store) | ||
assert store.filename in repr(store) | ||
assert store.filename in str(store) | ||
store.info() | ||
|
||
# storers | ||
with ensure_clean_store(self.path) as store: | ||
|
@@ -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 commentThe 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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||
assert store.is_open | ||
|
||
store.close() | ||
assert 'CLOSED' in str(store) | ||
assert 'CLOSED' in store.info() | ||
assert not store.is_open | ||
|
||
with ensure_clean_path(self.path) as path: | ||
|
@@ -4396,20 +4398,20 @@ def f(): | |
store1 = HDFStore(path) | ||
store2 = HDFStore(path) | ||
|
||
assert 'CLOSED' not in str(store1) | ||
assert 'CLOSED' not in str(store2) | ||
assert 'CLOSED' not in store1.info() | ||
assert 'CLOSED' not in store2.info() | ||
assert store1.is_open | ||
assert store2.is_open | ||
|
||
store1.close() | ||
assert 'CLOSED' in str(store1) | ||
assert 'CLOSED' in store1.info() | ||
assert not store1.is_open | ||
assert 'CLOSED' not in str(store2) | ||
assert 'CLOSED' not in store2.info() | ||
assert store2.is_open | ||
|
||
store2.close() | ||
assert 'CLOSED' in str(store1) | ||
assert 'CLOSED' in str(store2) | ||
assert 'CLOSED' in store1.info() | ||
assert 'CLOSED' in store2.info() | ||
assert not store1.is_open | ||
assert not store2.is_open | ||
|
||
|
@@ -4420,11 +4422,11 @@ def f(): | |
store2 = HDFStore(path) | ||
store2.append('df2', df) | ||
store2.close() | ||
assert 'CLOSED' in str(store2) | ||
assert 'CLOSED' in store2.info() | ||
assert not store2.is_open | ||
|
||
store.close() | ||
assert 'CLOSED' in str(store) | ||
assert 'CLOSED' in store.info() | ||
assert not store.is_open | ||
|
||
# double closing | ||
|
@@ -4433,11 +4435,11 @@ def f(): | |
|
||
store2 = HDFStore(path) | ||
store.close() | ||
assert 'CLOSED' in str(store) | ||
assert 'CLOSED' in store.info() | ||
assert not store.is_open | ||
|
||
store2.close() | ||
assert 'CLOSED' in str(store2) | ||
assert 'CLOSED' in store2.info() | ||
assert not store2.is_open | ||
|
||
# ops on a closed store | ||
|
@@ -4784,9 +4786,10 @@ def test_categorical(self): | |
tm.assert_frame_equal(result, df2) | ||
|
||
# Make sure the metadata is OK | ||
assert '/df2 ' in str(store) | ||
assert '/df2/meta/values_block_0/meta' in str(store) | ||
assert '/df2/meta/values_block_1/meta' in str(store) | ||
info = store.info() | ||
assert '/df2 ' in info | ||
assert '/df2/meta/values_block_0/meta' in info | ||
assert '/df2/meta/values_block_1/meta' in info | ||
|
||
# unordered | ||
s = Series(Categorical(['a', 'b', 'b', 'a', 'a', 'c'], categories=[ | ||
|
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