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]: convertTrials Tutorial uses Out of Date Syntax #515

Open
2 tasks done
jc192015 opened this issue Jul 19, 2023 · 6 comments
Open
2 tasks done

[Bug]: convertTrials Tutorial uses Out of Date Syntax #515

jc192015 opened this issue Jul 19, 2023 · 6 comments

Comments

@jc192015
Copy link

What happened?

When running matnwb(2.6.0), I got an error message. I am wondering that is due to a bug with matnwb. Or Could you please let me know how to fix it?
Thank you in advance for your time and help.

Steps to Reproduce

nwb = NwbFile();
nwb.units = types.core.Units('colnames',...
    {'spike_times', 'trials', 'waveforms'},...
    'description', 'Analysed Spike Events');

Error Message

Error using assert
Value of type `types.core.ElementIdentifiers` cannot be converted to type `types.hdmf_common.ElementIdentifiers`.

Error in types.util.correctType (line 60)
        assert(isa(val, type), ...

Error in types.util.checkDtype (line 96)
correctedValue = types.util.correctType(val, type);

Error in types.hdmf_common.DynamicTable/validate_id (line 90)
        val = types.util.checkDtype('id', 'types.hdmf_common.ElementIdentifiers', val);

Error in types.hdmf_common.DynamicTable/set.id (line 46)
        obj.id = obj.validate_id(val);

Error in types.util.dynamictable.checkConfig (line 58)
            DynamicTable.id = types.core.ElementIdentifiers('data', idData);

Error in types.core.Units (line 60)
            types.util.dynamictable.checkConfig(obj);

Operating System

Windows

Matlab Version

Matlab R2023a

Code of Conduct

@bendichter
Copy link
Contributor

I cannot reproduce. Can you please make sure you MatNWB is up-to-date? If you used git clone you might be able to simply call !git pull inside MATLAB while in the matnwb repo

@bendichter
Copy link
Contributor

If that doesn't work, you can delete MatNWB and download it again from here.

@jc192015
Copy link
Author

jc192015 commented Jul 19, 2023 via email

@bendichter
Copy link
Contributor

yeah, this looks like outdated code

@jc192015
Copy link
Author

So do you have an updated convertTrials.m?

@lawrence-mbf
Copy link
Collaborator

The code was probably added before validation changes to DynamicTable objects like TimeIntervals. There's no stop_time data for instance so the code needs to be reworked to include that.

@lawrence-mbf lawrence-mbf changed the title [Bug]: types.core.Units [Bug]: convertTrials Tutorial uses Out of Date Syntax 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

3 participants