pynwb icon indicating copy to clipboard operation
pynwb copied to clipboard

Possible to create electrodes table without required columns

Open rly opened this issue 6 years ago • 0 comments

By passing a DynamicTable in to the NWBFile constructor, it is possible to add an electrodes table with none of the required columns.

from pynwb import NWBFile, NWBHDF5IO, validate
from pynwb.core import DynamicTable
from datetime import datetime

electrodes = DynamicTable('electrodes', description='desc')
electrodes.add_column('a', description='col desc')
electrodes.add_row({'a': 1})

nwbfile = NWBFile(session_description='ADDME',
                  identifier='ADDME',
                  session_start_time=datetime.now().astimezone(),
                  electrodes=electrodes)

with NWBHDF5IO('temp.nwb', 'w') as io:
    io.write(nwbfile)
    validate(io)

rly avatar Nov 27 '19 00:11 rly