-
Notifications
You must be signed in to change notification settings - Fork 264
NF: allow truncated last track in trackvis file #346
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
NF: allow truncated last track in trackvis file #346
Conversation
Question - is What do people feel about the API break? Break is that this code returns different errors to the previous code. |
d92c386
to
b54671f
Compare
To avoid an API break, one option is If breaking the API is fine, and only two modes are needed, then any reason not to do |
I was thinking that we might want to allow different set of errors to pass, in the future, which might have different strings, or even lists specifying the errors that can pass. Might be a bit much though. |
From report on mailing list by Carolyn D. Langen - trackvis reader was giving TypeError when trying to read file where last track was shorter than declared in the 'n_points' data. Allow this situation for the last track with False argument to new `strict` kwarg of the trackvis `read` function. This is a slight API break because: * We are now raising a DataError if there are too few streamlines in the file, instead of a HeaderError; * We are raising a DataError if the track is truncated, rather than a TypeError when trying to create the points array.
b54671f
to
2d1e211
Compare
OK - I went for I think the API change is OK, it's pretty minor, and I think the errors should be |
Is this one OK to merge? Any other comments here? |
LGTM. Edit: I'm assuming you tried this on the |
Chris - yes - this does load the file the reporter shared... |
MRG: allow truncated last track in trackvis file From report on mailing list by Carolyn D. Langen - trackvis reader was giving TypeError when trying to read file where last track was shorter than declared in the 'n_points' data. Allow this situation for the last track with new 'strict' kwarg. This is a slight API break because: We are now raising a DataError if there are too few streamlines in the file, instead of a HeaderError; We are raising a DataError if the track is truncated, rather than a TypeError when trying to create the points array.
MRG: allow truncated last track in trackvis file From report on mailing list by Carolyn D. Langen - trackvis reader was giving TypeError when trying to read file where last track was shorter than declared in the 'n_points' data. Allow this situation for the last track with new 'strict' kwarg. This is a slight API break because: We are now raising a DataError if there are too few streamlines in the file, instead of a HeaderError; We are raising a DataError if the track is truncated, rather than a TypeError when trying to create the points array.
From report on mailing list by Carolyn D. Langen - trackvis reader was giving
TypeError when trying to read file where last track was shorter than declared
in the 'n_points' data.
Allow this situation for the last track with new 'errors' kwarg.
This is a slight API break because:
file, instead of a HeaderError;
TypeError when trying to create the points array.