G-Node / nix

Neuroscience information exchange format
https://readthedocs.org/projects/nixio/
Other
66 stars 36 forks source link

[dataAccess] bind position and count dimension to the array extent ... #755

Closed jgrewe closed 5 years ago

jgrewe commented 5 years ago

this solves an issue in which a {1,1} dataset could not be read

achilleas-k commented 5 years ago

Just to clarify, the old version would use the number of dimensions attached to an array to calculate offset and count, which would cause issues with {1, 1} arrays that had only one dimension object attached? And with this change, it now uses the actual shape of the data instead.

jgrewe commented 5 years ago

yes, this is true, but I agree the message was not good. Let me try again:

In cases that the data is 1D there is only a single dimension. When multi-tagging such data we require the tag positions array to be 2d (1st dim the number of points, second dim the number of dimension in the referenced data, 1d in this example). When reading the first position we must now read a slice form the positions array that is {1, 1} which is not equal to {1}! (This was the case in the previous version and failed)

edit: reading the position now depends on the shape of the positions array and no longer the referenced DataArray( does that make sense?)

achilleas-k commented 5 years ago

yes, this is true, but I agree the message was not good. Let me try again:

Nah, the change was pretty clear from the message and the code change. Just wanted to make sure I was understanding the underlying issue correctly.