h5tojson writes committed datatypes inline, so the reference to the named type is lost

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

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
json, python
Domain
data, tooling

Research direction

Start by reproducing with data/hdf5/committed_type.h5: run h5tojson on it and compare /DS1 and the root attribute attr1 against the datatypes entry for Sensor_Type. Then find where the type reference is lost, either in the H5pyPlugin type reading or in the JSON writer. Done when /DS1's type is a datatypes/<id> reference, and a round trip through jsontoh5 keeps the committed type. Coordinate with #97 for the schema side.

Written by the indexing model from the issue text.

Description

bug

h5tojson writes the type of a dataset or attribute that uses a committed (named) datatype inline, instead of as a "datatypes/<id>" reference to that type. The committed type itself is still written under datatypes, but nothing refers to it, so the link between the two is lost and a round trip through jsontoh5 produces an ordinary, uncommitted type.

Reproduced with h5json 2.0.1 on data/hdf5/committed_type.h5:

$ h5tojson committed_type.h5 > ct.json
$ jsontoh5 ct.json rt.h5
/DS1 type committed root attribute attr1 type committed
committed_type.h5 True True
rt.h5 False False

In ct.json, datatypes holds the Sensor_Type committed type, and /DS1's "type" is an inline compound rather than "datatypes/<id>".

Not investigated yet: where the reference is dropped (H5pyPlugin reading the type, or the JSON writer). The schema side is covered by #97, which makes "datatypes/<id>" accept 2.0 ids.

Dominant language
Python
Stars
81
Forks
26
Avg merge
55m
Merged PRs (30d)
9

Getting set up

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/hdf5-json

All issues in HDFGroup/hdf5-json

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.