Skip to content
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

View int8 and uin8 Data as binary string or encoded string #207

Open
hernot opened this issue Aug 14, 2020 · 0 comments
Open

View int8 and uin8 Data as binary string or encoded string #207

hernot opened this issue Aug 14, 2020 · 0 comments

Comments

@hernot
Copy link

hernot commented Aug 14, 2020

In python strings may be stored as encoded bytearray which in contrast to \0 terminated byte stringscan be compressed. The resulting 8 bit integer dataset is displayed as such by hdf-compas. Which makes inspections of such datasets a bit difficult. Therefore i do suggests to enhace dataset view for 8bit integer type datasets by providing alternative views like the following crude examples:

binary ....... view as plain binary bytes eg. print(bytearray(eight_bit_int_dataset[()]))

hex .......... view as hexstring instead eg. print("{:x}".format(eight_bit_int_dataset[()]))

<encoding> ... view as decoded bytarray content eg.
      selected_encoding="utf8"
      print(bytearray(eight_bit_int_dataset[()]).decode(selected_encoding))

That would allow to inspect hdf5 which encodes strings in eight bit int datasets instead of \0 terminated c-style string datasets.

NOTE as python2 is out of support this feature request shall only affect python3 branch #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant