View int8 and uin8 Data as binary string or encoded string

Open
#207 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start by locating the dataset view in the Python 3 branch referenced by issue #186 and inspect how 8-bit integer datasets are currently displayed. Define the available binary, hexadecimal, and selected-encoding views from the examples, then verify that HDF5 datasets containing encoded byte data can be inspected without changing existing string views.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
132
Forks
27
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HDFGroup/hdf-compass

All issues in HDFGroup/hdf-compass

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.