NeurodataWithoutBorders / matnwb

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

[Bug]: Error when Loading Compound data with Object References from a Datastub #528

Closed lawrence-mbf closed 11 months ago

lawrence-mbf commented 11 months ago

What happened?

attempting to call getRow or slicing into load causes a reshape error to occur.

Steps to Reproduce

1) assign intervals_trials with one of the columns being a TimeseriesReferenceVectorData type
2) add more than one row with some data. Ensure that slicing into this dataset works normally.
3) export the file.
4) reread with nwbRead
5) attempt to call either `getRow` with the table or `load` to subslice into the table.

Error Message

Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the
appropriate size for that dimension.

Error in types.untyped.DataStub/load_mat_style (line 241)
                    data.(fieldName) = reshape(data.(fieldName), expectedSize);

Error in indexing (line 384)
            data = obj.load_mat_style(CurrentSubRef.subs{:});

Error in types.util.dynamictable.getRow>select (line 135)
        selected = Vector.data(selectInd{:});

Error in types.util.dynamictable.getRow>select (line 170)
        selected{iRange} = select(DynamicTable,...

Error in types.util.dynamictable.getRow (line 44)
    row{i} = select(DynamicTable, indexNames, ind);

Error in types.hdmf_common.DynamicTable/getRow (line 119)
        row = types.util.dynamictable.getRow(obj, id, varargin{:});

Operating System

Windows

Matlab Version

R2023a

Code of Conduct