-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
ENH: #10143 Function to walk the group hierarchy of a PyTables HDF5 file #10932
Conversation
any reason not to call this just walk? |
pls add a note in whatsnew/0.17.0 in enhancements |
if (getattr(child._v_attrs, 'CLASS', None) == 'GROUP' | ||
and pandas_type is None): | ||
groups.append(child._v_name) | ||
elif pandas_type == 'frame': |
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.
yield ANY pandas_type objects, so don't need this complicated if
I've renamed walk() and included Series objects. However, I think you have a different API in mind. I am deliberately not yielding each Pandas object individually but yielding each PyTables group name, along with a tuple of its contents. This follows the os.walk API. I.e. each yield is
I think there are several advantages:
Note also:
Please let me know what you think before I write something in whatsnew/0.17.0 |
|
||
Returns | ||
------- | ||
A generator yielding tuples (`path`, `groups`, `frames`) where: |
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.
frames -> leaves
ok, looks reasonable. Pls add a whatsnew (and add this to the docs in io.rst), separate-sub-section in the HDF5 section. |
…les HDF5 file. This implementation is inspired by os.walk and follows the interface as much as possible.
050b67f
to
e013198
Compare
Including small fix to remove redundant '/' from group names.
e013198
to
b0ae071
Compare
closing, pls reopen if you can fix according to comments |
closes #10143
This implementation is inspired by os.walk and follows the interface as much as possible.