Skip to content

Fix scalar HDF5 object reference reads - #1599

Open
CAOShurong wants to merge 3 commits into
hdmf-dev:devfrom
CAOShurong:codex/fix-hdf5-scalar-object-references
Open

CAOShurong wants to merge 3 commits into
hdmf-dev:devfrom
CAOShurong:codex/fix-hdf5-scalar-object-references

Conversation

@CAOShurong

Copy link
Copy Markdown

Motivation

Fix #1584. HDF5IO can write scalar object references but fails to read them back: dataset targets access a nonexistent ReferenceBuilder.dtype, and group targets are sent to the dataset reader.

Use the existing reference resolver and its builder cache, and retain the object-reference dtype. Explicitly reject scalar region references so their selection cannot be silently discarded. Cyclic group references remain outside this change.

How to test the behavior?

The new tests cover scalar dataset/group references, shared target identity and the unsupported region-reference boundary. python -m pytest tests passes from both the checkout and installed wheel: 1,916 passed, 103 skipped, 1 xfailed. Independent installed checks also cover null references, empty/nonempty reference arrays and ordinary scalars. Repository-wide ruff check . and codespell pass with the pinned hook versions.

Checklist

  • Updated CHANGELOG.md.
  • Described the problem and solution.
  • Reviewed the contributing guide.
  • Used Fix #1584 notation.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

HDF5IO cannot read a scalar object reference: ReferenceBuilder has no dtype

1 participant