-
-
Notifications
You must be signed in to change notification settings - Fork 293
[loaders-] guess types (hdf5), understand unsigned int type (npy) #2713
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
- hdf5: read datatype codes from 1d arrays and guess column types. Done similarly to npy for floats and (un)signed integers. - npy: treat unsigned integer datatype as integer. Was `anytype` previously.
Previous version was referring to absent `pd.read_hdf5`
visidata/loaders/hdf5.py
Outdated
@@ -1,4 +1,4 @@ | |||
from visidata import VisiData, vd, Sheet, Path, Column, ItemColumn, BaseSheet | |||
from visidata import VisiData, vd, Sheet, Path, Column, ColumnItem, ItemColumn, BaseSheet, anytype |
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.
Nitpick: ItemColumn is the preferred nomenclature; ColumnItem is deprecated. (All column types are named FooColumn.)
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.
fixed
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.
Thanks, @maxfl ! The pandas loader is a little rusty so I appreciate that it's getting some updates.
@saulpw, you are welcome. There are a few other items that could be improved and I will definitely look more into the loaders as I work with vd more. On a related note, it is possible to extend vd with root loader. I'm not proposing a PR now as I need to gain some more experience and walk through the check list. By the way, visidata is wonderful. It is simplified my life so much. Thank you a lot! |
Hey @maxfl, did you test the numpy loader? When I created one that creates small arrays, and opened it with VisiData, the VisiData sheet was just blank. Did you notice something similar? |
This was mine, for reference:
|
dear @anjakefala, thank you for testing and providing an example. In fact I did test the updates and I do use visidata on a daily basis to work with hdf5/npz/root and tsv files. The only change I did for npy/npz is adding support for unsigned int to already existing int by modifying a single line. The original implementation by design works only with record arrays and requires columns to have names. It is not working with regular 1d/2d arrays. I think I might import the relevant code from hdf5 to numpy loader to make it work with regular arrays, but may be it does not belong to this particular PR. |
Thank you for that context @maxfl! I will add a small test file for npy, and then will go ahead and merge. =) |
anytype
previously.Only existing loaders were modified, no other added.