BlueBrain / HighFive

HighFive - Header-only C++ HDF5 interface
https://bluebrain.github.io/HighFive/
Boost Software License 1.0
687 stars 161 forks source link

Add named ctors for scalar and null dataspaces. #899

Closed 1uc closed 10 months ago

1uc commented 10 months ago

The issue is that:

DataSpace{DataSpace::dataspace_scalar};
DataSpace{DataSpace::dataspace_null};

are a simple dataspace with 0 elements and a simple dataspace with one element, respectively. This provides a safer alternative.

1uc commented 10 months ago

See:

codecov[bot] commented 10 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c660174) 85.34% compared to head (6acdc79) 85.38%. Report is 1 commits behind head on master.

Files Patch % Lines
include/highfive/bits/h5s_wrapper.hpp 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #899 +/- ## ========================================== + Coverage 85.34% 85.38% +0.03% ========================================== Files 84 84 Lines 5508 5527 +19 ========================================== + Hits 4701 4719 +18 - Misses 807 808 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

1uc commented 10 months ago

Precedence: https://github.com/BlueBrain/HighFive/blob/9e5cb5b672a01e9c189cc102ab6ee89a371571f4/include/highfive/H5PropertyList.hpp#L178

https://github.com/BlueBrain/HighFive/blob/9e5cb5b672a01e9c189cc102ab6ee89a371571f4/include/highfive/H5DataSpace.hpp#L218

https://github.com/BlueBrain/HighFive/blob/9e5cb5b672a01e9c189cc102ab6ee89a371571f4/include/highfive/H5DataSpace.hpp#L230