-
Notifications
You must be signed in to change notification settings - Fork 32
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
Unexpected additional entry in vectordata #513
Comments
Hi @GoktugAlkan , Is the data returned by |
@lawrence-mbf Exactly, normally there should be an error for element Interestingly, also the preview of says that there are |
@GoktugAlkan With an example script, I can recreate the bug where the data is duplicated if the non-contiguous indices are invalid. I do get an error if I index outside the allocated space though. |
@lawrence-mbf Did you try to save the nwb file (nwbExport), then read it (nwbRead), and then access entry |
If you run the following script and call Here is the full scriptfilename = 'test.h5';
fullDatasetPath = '/data';
datasetName = 'data';
dataSize = 10;
if 2 ~= exist(filename, 'file')
h5create(filename, fullDatasetPath, dataSize);
end
h5write(filename, fullDatasetPath, (1:10));
h5disp(filename);
DataStub = types.untyped.DataStub(filename, fullDatasetPath); |
Note that just indexing the out-of-bounds |
@GoktugAlkan Out of curiosity, if you use double values for the "labels" property does the same behavior occur? Or, if you have DataStubs of other types, does indexing out of bounds do the same thing? |
Hi @GoktugAlkan , Please check and let me know if this PR fixes things: #514 |
Hello,
We created nwb files where the field
nwb.units
is populated according to our previous discussion. We also added a cell array that contains the labels of all the spikes that were detected. This cell array can be accessed by executingnwb.units.vectordata.get('labels')
.When we execute
nwb.units.vectordata.get('labels')
we see the following:This means that we should have 10327084 entries in this array, which is correct so far. However, when we execute
nwb.units.vectordata.get('labels').data(10327084+1)
we get the following answer:We are wondering why there is an empty entry at index 10327084+1 although the whole cell array should just contain 10327084 entries. We would have expected to see an error when we execute this command.
Because of this issue we are not sure trust the answers when we load individual entries of this array by executing, for example,
nwb.units.vectordata.get('labels').data([10275652,10327080])
.Remark: Although
nwb.units.vectordata.get('labels').data(10327084+1)
is an empty entry executingnwb.units.vectordata.get('labels').data([10275652,10327085]
outputsMany thanks in advance for your help.
The text was updated successfully, but these errors were encountered: