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

Set H5S_NULL if the data is not chunked and is empty. #436

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

lawrence-mbf
Copy link
Collaborator

Motivation

While investigating #434 it seems that colnames is not writable if it is empty. This is technically allowable given the schema simply listing its shape as one-dimensional with no bounds. However, calling io.writeAttribute appears to result in an unknown HDF5 error, perhaps because the dimensions are set to zero.

The solution right now is something like h5py/h5py#279 when the dataset is actually empty. Not sure how this would need to work for chunked datasets as these can be amended.

How to test the behavior?

Running the example in this comment should work:
#434 (comment)

Checklist

  • Have you ensured the PR description clearly describes the problem and solutions?
  • Have you checked to ensure that there aren't other open or previously closed Pull Requests for the same change?
  • If this PR fixes an issue, is the first line of the PR description fix #XX where XX is the issue number?

@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #436 (d94bf8c) into master (8879f01) will decrease coverage by 1.21%.
The diff coverage is 100.00%.

❗ Current head d94bf8c differs from pull request most recent head 6e6a043. Consider uploading reports for the commit 6e6a043 to get more accurate results

@@            Coverage Diff             @@
##           master     #436      +/-   ##
==========================================
- Coverage   87.25%   86.05%   -1.21%     
==========================================
  Files         128      125       -3     
  Lines        5250     5127     -123     
==========================================
- Hits         4581     4412     -169     
- Misses        669      715      +46     
Impacted Files Coverage Δ
+io/mapData2H5.m 94.73% <100.00%> (-2.77%) ⬇️
+io/getMatType.m 14.70% <0.00%> (-37.93%) ⬇️
+types/+untyped/+datapipe/+properties/Shuffle.m 62.50% <0.00%> (-37.50%) ⬇️
+io/resolvePath.m 52.00% <0.00%> (-32.00%) ⬇️
+io/getMatTypeSize.m 66.66% <0.00%> (-22.23%) ⬇️
+types/+untyped/Set.m 51.32% <0.00%> (-14.16%) ⬇️
+types/+util/checkDtype.m 71.60% <0.00%> (-11.73%) ⬇️
+types/+util/+dynamictable/addRawData.m 84.84% <0.00%> (-10.35%) ⬇️
+types/+util/+dynamictable/getTypeMap.m 90.47% <0.00%> (-9.53%) ⬇️
nwbExport.m 64.28% <0.00%> (-7.15%) ⬇️
... and 30 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lawrence-mbf lawrence-mbf self-assigned this Jan 23, 2023
@lawrence-mbf lawrence-mbf marked this pull request as ready for review January 23, 2023 20:48
@lawrence-mbf lawrence-mbf removed the request for review from rly January 23, 2023 21:52
@lawrence-mbf lawrence-mbf merged commit 9400310 into master Jan 23, 2023
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.

1 participant