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]: NWBFile.stimulus_templates should accept Images type #494

Closed
2 tasks done
rly opened this issue Feb 24, 2023 · 0 comments · Fixed by #495
Closed
2 tasks done

[Bug]: NWBFile.stimulus_templates should accept Images type #494

rly opened this issue Feb 24, 2023 · 0 comments · Fixed by #495
Assignees

Comments

@rly
Copy link
Contributor

rly commented Feb 24, 2023

What happened?

NWB schema 2.6.0 allows both TimeSeries and Images to be added to the /stimulus_templates group of an NWB file.
https://github.com/NeurodataWithoutBorders/nwb-schema/blob/19c4bbb36effb1454253072f70ebf2c83f2ea095/core/nwb.file.yaml#L134-L145

However, when an Images object is added, validation fails. This is because the generated code in matnwb/+types/+core/NWBFile.m says:

    function val = validate_stimulus_templates(obj, val)
        constrained = {'types.core.TimeSeries'};
        types.util.checkSet('stimulus_templates', struct(), constrained, val);
    end

Image of a stack trace from the user
image1

Similarly, the /acquisition, /analysis, and /scratch groups all allow multiple data types. The generated validator code does not seem to allow for that, but it should.

Steps to Reproduce

nwb = NwbFile( ...
    'session_description', 'mouse in open exploration',...
    'identifier', ['Mouse5_Day3'], ...
    'session_start_time', datetime(2018, 4, 25, 2, 30, 3));
nwb.stimulus_templates.set("Test", types.core.Images());

Error Message

see above

Operating System

macOS

Matlab Version

unknown

Code of Conduct

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