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

Add API to attach hdf5 attributes to datasets #1978

Closed
wants to merge 4 commits into from

Conversation

yuk-m-labs
Copy link

ARTIQ Pull Request

Description of Changes

Expose API to let user attach HDF5 attributes to datasets. The attributes can be attached to the HDF5 group datasets, or to HDF5 datasets under this group by specifying the key.

Usage demo is given in examples/no_hardware/repository/hdf5_attributes.py

Related Issue

Closes #1691

Type of Changes

Type
✨ New feature
📜 Docs

Steps (Choose relevant, delete irrelevant before submitting)

All Pull Requests

  • Use correct spelling and grammar.
  • Update RELEASE_NOTES.rst if there are noteworthy changes, especially if there are changes to existing APIs.
  • Close/update issues.
  • Check the copyright situation of your changes and sign off your patches (git commit --signoff, see copyright).

Code Changes

  • Run flake8 to check code style (follow PEP-8 style). flake8 has issues with parsing Migen/gateware code, ignore as necessary.
  • Test your changes or have someone test them. Mention what was tested and how.
  • Add and check docstrings and comments
  • Check, test, and update the unittests in /artiq/test/ or gateware simulations in /artiq/gateware/test

Git Logistics

  • Split your contribution into logically separate changes (git rebase --interactive). Merge/squash/fixup commits that just fix or amend previous commits. Remove unintended changes & cleanup. See tutorial.
  • Write short & meaningful commit messages. Review each commit for messages (git show). Format:
    topic: description. < 50 characters total.
    
    Longer description. < 70 characters per line
    

Licensing

See copyright & licensing for more info.
ARTIQ files that do not contain a license header are copyrighted by M-Labs Limited and are licensed under LGPLv3+.

@yuk-m-labs yuk-m-labs changed the title hdf5 Add API to attach hdf5 attributes to datasets Oct 18, 2022
Signed-off-by: yuk <yuk@m-labs.hk>
Signed-off-by: yuk <yuk@m-labs.hk>
Signed-off-by: yuk <yuk@m-labs.hk>
Signed-off-by: yuk <yuk@m-labs.hk>
broadcast=True, archive=True)
self.set_dataset_metadata("dummy", {"k1": "v1", "k2": "v2"})

# Attach metadata to an absent key is no-op
Copy link
Member

@sbourdeauducq sbourdeauducq Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example should become a unit test and the comments assertions.

@thomasfire
Copy link
Contributor

Moved to #1997

@thomasfire thomasfire closed this Nov 14, 2022
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.

save custom attributes in archived h5py data files
3 participants