Skip to content

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

Description

@hernot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions