pynwb
pynwb copied to clipboard
Possible to create electrodes table without required columns
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)