NeurodataWithoutBorders / matnwb

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

[Bug]: dynamic table getRow using 'useId' true fails for index which is not positive ,e.g. index 0 #573

Open achilleasNP opened 1 week ago

achilleasNP commented 1 week ago

What happened?

When using my_table.getRow(0,'useId', true) (where my_table is a dynamic table with an id 0 row), I was expecting to get the row corresponding to id 0, but instead I get an error message.

Steps to Reproduce

col1 = types.hdmf_common.VectorData( ...
    'description', 'column #1', ...
    'data', [1;2;3] ...
    );

my_table = types.hdmf_common.DynamicTable( ...
    'description', 'an_example table', ...
    'colnames', {'col1'}, ...
    'col1', col1, ...
    'id', types.hdmf_common.ElementIdentifiers('data', [0;1;2]) ...
    );
my_table.getRow(0, 'useId', true);

Error Message

Error using types.util.dynamictable.getRow (line 13)
Expected input to be positive.

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

Operating System

Windows

Matlab Version

24.1.0.2603908 (R2024a) Update 3

Code of Conduct

lawrence-mbf commented 1 week ago

Hi @achilleasNP does the merge on the master branch resolve this issue?