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

Setup HDF5 dataset without having data ahead of time #747

Merged
merged 22 commits into from
Jul 21, 2022
Merged

Conversation

ajtritt
Copy link
Contributor

@ajtritt ajtritt commented Jul 19, 2022

Motivation

Add the ability to create a dataset on disk and get access to the handle to the dataset without having to close and repoen a file.

How to test the behavior?

dataio = H5DataIO(shape=(5,), dtype=int)
foo = Foo('foo1', dataio, "I am foo1", 17, 3.14)
bucket = FooBucket('bucket1', [foo])
foofile = FooFile(buckets=[bucket])

io = HDF5IO(self.path, manager=self.manager, mode='w')
io.write(foofile)

foo.my_data.dataset[:] = [0, 1, 2, 3, 4]
io.close()

Checklist

  • Did you update CHANGELOG.md with your changes?
  • Have you checked our Contributing document?
  • Have you ensured the PR clearly describes the problem and the solution?
  • Is your contribution compliant with our coding style? This can be checked running flake8 from the source directory.
  • Have you checked to ensure that there aren't other open Pull Requests for the same change?
  • Have you included the relevant issue number using "Fix #XXX" notation where XXX is the issue number? By including "Fix #XXX" you allow GitHub to close issue #XXX when the PR is merged.

@codecov
Copy link

codecov bot commented Jul 19, 2022

Codecov Report

Merging #747 (a9c6fbf) into dev (ef0a800) will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #747      +/-   ##
==========================================
+ Coverage   87.47%   87.57%   +0.09%     
==========================================
  Files          44       44              
  Lines        8790     8834      +44     
  Branches     2023     2033      +10     
==========================================
+ Hits         7689     7736      +47     
+ Misses        786      784       -2     
+ Partials      315      314       -1     
Impacted Files Coverage Δ
src/hdmf/backends/hdf5/h5_utils.py 86.58% <100.00%> (+0.50%) ⬆️
src/hdmf/backends/hdf5/h5tools.py 82.03% <100.00%> (+0.37%) ⬆️
src/hdmf/build/objectmapper.py 92.72% <100.00%> (+0.36%) ⬆️
src/hdmf/data_utils.py 90.22% <100.00%> (+0.34%) ⬆️
src/hdmf/utils.py 96.53% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef0a800...a9c6fbf. Read the comment docs.

@ajtritt ajtritt requested review from oruebel and rly July 19, 2022 00:36
@ajtritt ajtritt changed the title Enh/h5 file setup Setup HDF5 dataset without having data ahead of time Jul 19, 2022
src/hdmf/data_utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@oruebel oruebel left a comment

Choose a reason for hiding this comment

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

Overall this looks good to me.

src/hdmf/data_utils.py Outdated Show resolved Hide resolved
oruebel
oruebel previously approved these changes Jul 20, 2022
Co-authored-by: Oliver Ruebel <[email protected]>
oruebel
oruebel previously approved these changes Jul 20, 2022
@rly
Copy link
Contributor

rly commented Jul 21, 2022

Please fix flake8 changes and add a note to the changelog

@rly
Copy link
Contributor

rly commented Jul 21, 2022

Thanks. LGTM!

@ajtritt ajtritt merged commit a476142 into dev Jul 21, 2022
@rly rly deleted the enh/h5_file_setup branch July 25, 2022 13:16
@rly rly mentioned this pull request Jul 26, 2024
4 tasks
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.

3 participants