Repository navigation
Fix conversion of tables with char array columns - #63
Open
h-mayorquin wants to merge 1 commit into
Open
h-mayorquin wants to merge 1 commit into
h-mayorquin wants to merge 1 commit into
Conversation
Owner
|
Glad to know that the library is helpful! The PR looks great! I'll merge this after the fix to I'll try to support MATLAB table v5 as soon as I can |
Owner
|
I'm a bit rusty with this. Is it possible to add a |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi, I maintain neuroconv, a library used to convert neurophysiology data to a standard called NWB. We use your library among others to read a lot of MATLAB files because that's a format in which labs commonly write, so first, big thanks.
Now, I have found an issue. When reading some lab tables with
load_from_matI realized that a table with a char array column liketable(['ab ';'cde'])is not converted and comes back asMatlabOpaquewith a "tuple index out of range" warning.decode_char_arraysremoves the char axis so the column reachesto_dataframeas a one-dimensional array with one string per row, andcoldata.shape[1]fails.This only happens for tables saved with R2024b or older (
versionSavedFrom4 or lower), as tables saved with R2025a or newer (versionSavedFrom5) are not supported yet.This PR fixes this. For testing, I generated new files for the test data (
test_table_char_v7.matandtest_table_char_v73.mat) with their own script (note that I used R2024b). If you want me to modify one of your files instead I am ok with it.The
calendarDurationtests fail with numpy 2.5 or newer, with and without this change, and I will open a separate issue for that soon.