-
Notifications
You must be signed in to change notification settings - Fork 4
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
HDF5
file structure reorganisation, and InterfaceComponent
readability
#312
Conversation
* Trying to decipher structs * Further towards reading a struct * Bypass the stack-smash bug. MATLAB saves character arrays as uint16s, and HDF5 is unable to interpret them as chars. As such, we need to do manual conversion in the test. * Rename binary and update contents
…ility (#280) * Reorganise hdf5 unit tests - Move uint16 to char/str functions to the unit test utils file - Create hdf5_and_tdms_objects subdirectory of unit/ to hold unit tests on interaction between hdf5 and tdms classes - Move the Matrix<double> test from test_hdf5_io into the new subdirectory - Data files needed for unit tests are defined in a unit_test_utils namespace to avoid redefinition across multiple files * Create file to test interface and hdf5 interactions - Add docstrings to interface.h since these are missing and I've just had to work out what they do - Create a matlab script that can reproduce the class_data.mat file which the hdf5 unit tests will try to create tdms objects from - Create the barebones test_hdf5_interface file * HDF5Reader can read from .mat file and produce an InterfaceComponent * File restructure: accounting for how many tests we are going to have with HDF5 * Prune includes * Add .mat file for HDF5-TDMS-object unit tests to run. - Adds scripts to reproduce this data, so in theory a new user can run a short MATLAB script to reproduce this - Had a play with trying to get setup-matlab to run these scripts before the unit tests, but alas, no.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #312 +/- ##
===================================
Coverage 25% 25%
===================================
Files 63 66 +3
Lines 3596 3607 +11
===================================
+ Hits 903 908 +5
- Misses 2693 2699 +6
☔ View full report in Codecov by Sentry. |
// Read the InterfaceComponent in as a 2-element double array | ||
double read_buffer[2]; | ||
read_field_from_struct("interface", plane, read_buffer); | ||
// The index that is read in should have 1 subtracted from it, to account for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forward thinking here: if we/someone wants to also remove MATLAB from the input generation in the future, they'll need to develop some kind of workaround for these usage cases where we have to subtract one due to MATLAB indexing.
Co-authored-by: Will Graham <[email protected]>
This PR is a single
git cherry-pick
of the merge commit of #280 but now (eventually) targetingmain
.Part of
Continues from
libhdf5
and basic implementation class structure. #304Supercedes
Actual code notes and change description
... are in
HDF5
file structure reorganisation, andInterfaceComponent
readability #280For future working, I think the "move files" and "add tests" steps here should have been separate PRs.
main
to ensure none of the review improvements are lost.