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

Errror using dynamicTable.getRow when ID is 0 #310

Closed
ryaoki opened this issue Sep 29, 2021 · 4 comments · Fixed by #311
Closed

Errror using dynamicTable.getRow when ID is 0 #310

ryaoki opened this issue Sep 29, 2021 · 4 comments · Fixed by #311

Comments

@ryaoki
Copy link

ryaoki commented Sep 29, 2021

Hi,
When I ran this,
row = nwb.units.getRow(0, 'useID', true, 'columns', {'spike_times'});

I got the following error.

Error using types.util.dynamictable.getRow (line 13)
Expected input to be positive.

Error in types.hdmf_common.DynamicTable/getRow (line
135)
        row = types.util.dynamictable.getRow(obj, id,
        varargin{:});

This can be hackily solved by commenting out ln.13 in types.util.dynamictable.getRow.

@oruebel
Copy link
Contributor

oruebel commented Sep 29, 2021

I believe the first parameter of getRow is the index (not the Id) of the row. Since Matlab uses 1-based indexing, I believe the correct call to retrieve the first row would be nwb.units.getRow(1, ...) instead of nwb.units.getRow(0, ...)

@ryaoki
Copy link
Author

ryaoki commented Sep 29, 2021

Thank you for reply. But I wanted to retrieve the row with ID = 0, not the first row.
I thought that if 'useID' is set to true, then first parameters is recognized as ID, not the index of the row...

@oruebel
Copy link
Contributor

oruebel commented Sep 29, 2021

CC @bendichter

@ryaoki
Copy link
Author

ryaoki commented Oct 5, 2021

The issue is fixed. Thanks a lot!

@ryaoki ryaoki closed this as completed Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants