NeurodataWithoutBorders / matnwb

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

ecephys tutorial broken #94

Closed bendichter closed 5 years ago

bendichter commented 5 years ago

The tutorials/ecephys throws the following error:

Error using types.util.checkConstraint (line 16)
Property `general_extracellular_ephys.electrodes` should be one of
type(s) {types.core.ElectrodeGroup}.

Error in
types.util.checkSet>@(nm,val)types.util.checkConstraint(pname,nm,namedprops,constraints,val)
(line 10)
    @(nm, val)types.util.checkConstraint(pname, nm, namedprops,
    constraints, val));

Error in types.untyped.Set/set (line 104)
                    obj.fcn(name{i}, elem);

Error in ecephys (line 79)
nwb.general_extracellular_ephys.set('electrodes', electrode_table);

Looking at the schema, both ElectrodeGroup and DynamicTable should be accepted:

https://github.com/NeurodataWithoutBorders/matnwb/blob/fc9064e913b940a40fe2f5e6635045dc0b136054/schema/core/nwb.file.yaml#L311-L320

lawrence-mbf commented 5 years ago

This is a part of the new elision rules. Basically, anything with an explicit name like this was moved to their own property like general_extracellular_ephys_electrodes. The Constrained Set now just checks for ElectrodeGroup instead. So line 79 in the tutorial should look like this instead of the Set syntax:

nwb.general_extracellular_ephys_electrodes = electrode_table;

ElectrodeGroup objects still use the old syntax.

bendichter commented 5 years ago

Ah ok thanks for the clarification

bendichter commented 5 years ago

Thanks, that fixed it. I like this new syntax.