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

[Bug]: #516

Closed
2 tasks done
jc192015 opened this issue Jul 20, 2023 · 3 comments
Closed
2 tasks done

[Bug]: #516

jc192015 opened this issue Jul 20, 2023 · 3 comments
Assignees

Comments

@jc192015
Copy link

What happened?

Failed to create a TimeIntervals table. I am wondering if there is something with the installed MatNWB (2.6.0).
Thank you in advance for your time.

Steps to Reproduce

trialTypeStr = {'HitR';
    'HitL';
    'ErrR';
    'ErrL';
    'NoLickR';
    'NoLickL';
    'LickEarly';
    'StimTrials'};
    
keyNames = {'PoleInTime',    'PoleOutTime',    'CueTime' ,   'GoodTrials',    'Photostimulatio…'};

trialIds = [1:213];

trials_epoch = types.core.TimeIntervals(...
      'colnames', [trialTypeStr; keyNames .';...
        {'start_time'; 'stop_time'; 'acquisition'; 'timeseries'}],...
    'description', 'trial data and properties', ...
    'id', types.hdmf_common.ElementIdentifiers('data', trialIds));

Error Message

Error using assert
Special column `id` of DynamicTable needs to match the detected height of 0. Found 213 IDs.

Error in types.util.dynamictable.checkConfig (line 65)
    assert(tableHeight == getVectorHeight(DynamicTable.id), ...

Error in types.core.TimeIntervals (line 45)
            types.util.dynamictable.checkConfig(obj);

Operating System

Windows

Matlab Version

R2023a

Code of Conduct

@lawrence-mbf lawrence-mbf self-assigned this Jul 20, 2023
@lawrence-mbf
Copy link
Collaborator

Hi @jc192015 did you base this code off of one of our tutorials? The validation for the shape of the TimeIntervals table assumes that all columns defined by colname are populated with the same number of rows as id is. This is the meat of the error itself.

If you wish to add all 213 rows you need to set them all at once or use addRow in a loop per row.

@jc192015
Copy link
Author

jc192015 commented Jul 20, 2023 via email

@lawrence-mbf
Copy link
Collaborator

Continued in #527

@lawrence-mbf lawrence-mbf closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2023
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

No branches or pull requests

2 participants