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]: Unexpected attributes with nwbRead Dandiset 000115 #470

Closed
hungtuchen opened this issue Nov 4, 2022 · 9 comments · Fixed by #475
Closed

[Bug]: Unexpected attributes with nwbRead Dandiset 000115 #470

hungtuchen opened this issue Nov 4, 2022 · 9 comments · Fixed by #475
Assignees

Comments

@hungtuchen
Copy link

What happened?

Unexpected properties {camera_device 1} when using nwbRead to read data file https://dandiarchive.org/dandiset/000115/0.210914.1732/sub-despereaux/sub-despereaux_ses-despereaux-07_behavior+ecephys.nwb.

Steps to Reproduce

addpath(genpath(pwd));
generateCore();
nwb = nwbRead('pathname_to_file')

And `util.getSchemaVersion('pathname_to_file')` returns '2.3.0'

Error Message

Error using assert
Unexpected properties {camera_device 1}.

Your schema version may be incompatible with the file.  Consider checking the schema version of the
file with `util.getSchemaVersion(filename)` and comparing with the YAML namespace version present in
nwb-schema/core/nwb.namespace.yaml

Error in types.util.checkUnset (line 13)
assert(isempty(dropped),...

Error in types.ndx_franklab_novela.NwbImageSeries (line 11)
            types.util.checkUnset(obj, unique(varargin(1:2:end)));

Error in io.parseGroup (line 85)
    parsed = eval([Type.typename '(kwargs{:})']);

Error in io.parseGroup (line 38)
    subg = io.parseGroup(filename, group, Blacklist);

Error in io.parseGroup (line 38)
    subg = io.parseGroup(filename, group, Blacklist);

Error in io.parseGroup (line 38)
    subg = io.parseGroup(filename, group, Blacklist);

Error in io.parseGroup (line 38)
    subg = io.parseGroup(filename, group, Blacklist);

Error in nwbRead (line 59)
nwb = io.parseGroup(filename, h5info(filename), Blacklist); 


### Operating System

macOS

### Matlab Version

R2022b

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/neurodatawithoutborders/matnwb/blob/master/.github/CODE_OF_CONDUCT.md)
- [X] Have you ensured this bug was not already [reported](https://github.com/NeurodataWithoutBorders/matnwb/issues)?
@bendichter
Copy link
Contributor

Hey @transedward thanks for opening the issue. This is going to be a bit tricky to reproduce because it's a 90 GB file. In Python I'd just stream it using fsspec, but the tools to do this in MATLAB are not as good. I'm downloading the file but it could take a while.

Looking at the traceback it looks like the issue is with the ndx_franklab_novela extension, not the core schema. Is it possible that you generated the schema for this extension and that it conflicts with the schema in the file? @lawrence-mbf , any thoughts on this?

@lawrence-mbf
Copy link
Collaborator

I agree that it's most likely coming from the extension schema and not the main one. I just finished downloading a representative file and it seems to come from the CameraDevice object which does come from the ndx-franklab-novela extension schema.

@lawrence-mbf
Copy link
Collaborator

I think see what the issue is. It has to do with the modifications to the device property in the core ImageSeries. The problematic type--NwbImageSeries--has modified the property to expand it to contain multiple Device objects. This causes a subtle breakage where the default value of device is not supposed to be [] as expected by checkUnset.

@yarikoptic
Copy link

Is the fix coming?

@lawrence-mbf
Copy link
Collaborator

It requires a larger change to class generation where checkUnset is used. But yes, working on it.

@lawrence-mbf
Copy link
Collaborator

@transedward @yarikoptic Let me know if #475 fixes this issue.

@hungtuchen
Copy link
Author

Hi @lawrence-mbf, thank you for the fix and update. There are some other errors appearing as follows. Let me know what I can do, thanks!

Error using builtin
Incorrect number or types of inputs or outputs for function 'flip'.

Error in flip (line 32)
      [varargout{1:nargout}] = builtin(mfilename, varargin{:});

Error in flipud (line 14)
x = flip(x,1);

Error in types.untyped.DataStub/load_mat_style (line 171)
                    cell2mat(flipud(points)) - 1);

Error in types.untyped.DataStub/load (line 120)
                data = obj.load_mat_style(varargin{1});

Error in indexing (line 369)
                B = builtin('subsref', obj, S);

Error in types.util.checkDtype (line 80)
        val = val.load(1);

Error in types.hdmf_common.DynamicTableRegion/validate_data (line 38)
        val = types.util.checkDtype('data', 'int32', val);

Error in types.hdmf_common.Data/set.data (line 29)
        obj.data = obj.validate_data(val);

Error in types.hdmf_common.Data (line 22)
        obj.data = p.Results.data;

Error in types.hdmf_common.VectorData (line 13)
        obj = [email protected]_common.Data(varargin{:});

Error in types.hdmf_common.DynamicTableRegion (line 13)
        obj = [email protected]_common.VectorData(varargin{:});

Error in io.parseDataset (line 81)
    parsed = eval([Type.typename '(kwargs{:})']);

Error in io.parseGroup (line 22)
    dataset = io.parseDataset(filename, datasetInfo, fullPath, Blacklist);

Error in io.parseGroup (line 38)
    subg = io.parseGroup(filename, group, Blacklist);

Error in io.parseGroup (line 38)
    subg = io.parseGroup(filename, group, Blacklist);

Error in nwbRead (line 59)
nwb = io.parseGroup(filename, h5info(filename), Blacklist);

@hungtuchen
Copy link
Author

Interestingly, it seems to be working with the file in the draft version (dandiset/000115/draft). Thanks for the fix!

@lawrence-mbf
Copy link
Collaborator

Good to hear! I'll check on that error in the original file anyway in the meantime.

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.

4 participants