feat: skip fields with undocumented classes instead of hard error #119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, if a .mat file contains fields such as
audioplayer
and others that are undocumented,matread
will error without returning any read data. This pull request adds functionality to warn the user and returnmissing
instead. The functionality is implemented similarly in bothMAT_V5
andMAT_HDF5
, the main difference I've noted is that these undocumented fields sometimes come with a ghost field at the root level which is handled slightly differently.In my work, I am trying to process .mat files with many fields/structures/sub-structures and often these undocumented fields are not the ones I am trying to work with and it is frustrating when the read process crashes (and in V5 I can't work around this by reading in only sub-paths of the file). This PR will allow working with the rest of the file and skip only what is unreadable.
This is related to #23 , but instead takes the approach of skipping these fields. If #23 is ever completed/incorporated, this should become obsolete functionality.