NeurodataWithoutBorders / matnwb

A Matlab interface for reading and writing NWB files
BSD 2-Clause "Simplified" License
49 stars 32 forks source link

Error when loading DANDI files - Unexpected properties {unit} #244

Closed mpompolas closed 1 year ago

mpompolas commented 3 years ago

Found this issue when trying to open a few files from DANDI. Here are the first 3 I came across:

https://girder.dandiarchive.org/api/v1/item/5eda776f99f25d97bd27979c/download https://girder.dandiarchive.org/api/v1/item/5eda897599f25d97bd279891/download https://girder.dandiarchive.org/api/v1/item/5eda8e3699f25d97bd2798cf/download

Error using types.util.checkUnset (line 13)
Unexpected properties {unit}.
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.hdmf_common.VectorData (line 26)
            types.util.checkUnset(obj,
            unique(varargin(1:2:end)));
Error in io.parseDataset (line 72)
    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 nwbRead (line 33)
nwb = io.parseGroup(filename, h5info(filename),
Blacklist);

@bendichter mentioned that these files probably only have spikes, not raw signals.

HDFView, pynwb and nwbwidgets work fine - only the Matlab side is problematic.

rly commented 3 years ago

NWB version 2.2.0 added “sampling_rate” and “unit” attributes to “waveform_mean” and “waveform_sd” datasets/columns in Units table. (It also added “resolution” attribute to “spike_times” column of Units.) This file has the "unit" attribute on the "Units.waveform_mean" column.

I believe that extending attributes on a VectorData column of a table has not been done prior to this change (i.e., not defining a new data type with additional attributes but adding attributes on a 'neurodata_type_inc'-only dataset). We had to make changes in PyNWB to map these correctly, so this might be the source of the problem. See https://github.com/NeurodataWithoutBorders/nwb-schema/blob/dev/core/nwb.misc.yaml#L247 for the schema.

lawrence-mbf commented 3 years ago

Yep, related to https://github.com/NeurodataWithoutBorders/matnwb/issues/43

lawrence-mbf commented 1 year ago

Duplicate of #238