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

load_matrix(): Support non-numerical first row #2394

Open
Lestropie opened this issue Nov 18, 2021 · 0 comments
Open

load_matrix(): Support non-numerical first row #2394

Lestropie opened this issue Nov 18, 2021 · 0 comments
Labels

Comments

@Lestropie
Copy link
Member

Reporting based on bids-standard/bids-specification#352.

In the BIDS specification, column headers for .tsv files are not commented out, they are the first non-comment line in the file. This means that if fed to e.g. MR::load_matrix(), that function will fail.

What would need to happen is for, upon receiving an Exception (ideally one specific to receipt of non-numerical data, but only on performance grounds), the parser should make a second attempt at parsing the file, but stashing the contents of the first non-empty line. If parsing the remaining content of the file as numerical data works, then the contents of that first line should be added to the KeyValues instance under some prescribed key.

Unsure what should occur if the data are accessed via load_vector(), the data are stored specifically as a column vector, and the first row is non-numeric... should that be interpreted as a column label, or an error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant