diff --git a/README.md b/README.md index 23b95fe..f5c9e81 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ classDiagram columns -------------------------------------- id : VectorData[int] - contact : DynamicTableRegion, optional + contact : DynamicTableRegion --> target : ContactsTable reference_contact : DynamicTableRegion, optional --> target : ContactsTable diff --git a/spec/ndx-extracellular-channels.extensions.yaml b/spec/ndx-extracellular-channels.extensions.yaml index 1f10412..05ed9ea 100644 --- a/spec/ndx-extracellular-channels.extensions.yaml +++ b/spec/ndx-extracellular-channels.extensions.yaml @@ -71,6 +71,7 @@ groups: neurodata_type_inc: VectorData dtype: text doc: Shape of the contact; e.g. 'circle' + quantity: '?' - name: radius_in_um neurodata_type_inc: VectorData dtype: float @@ -221,7 +222,6 @@ groups: - name: contact neurodata_type_inc: DynamicTableRegion doc: The row in a ContactsTable that represents the contact used as a channel. - quantity: '?' - name: reference_contact neurodata_type_inc: DynamicTableRegion doc: The row in a ContactsTable that represents the contact used as a reference. diff --git a/src/pynwb/ndx_extracellular_channels/__init__.py b/src/pynwb/ndx_extracellular_channels/__init__.py index 6b4c73c..2edcb68 100644 --- a/src/pynwb/ndx_extracellular_channels/__init__.py +++ b/src/pynwb/ndx_extracellular_channels/__init__.py @@ -28,5 +28,16 @@ from .io import from_probeinterface, to_probeinterface +__all__ = ( + "ProbeInsertion", + "ContactsTable", + "ProbeModel", + "Probe", + "ChannelsTable", + "ExtracellularSeries", + "from_probeinterface", + "to_probeinterface", +) + # Remove these functions from the package del load_namespaces, get_class diff --git a/src/pynwb/tests/test_classes.py b/src/pynwb/tests/test_classes.py index 6eb3c63..870096e 100644 --- a/src/pynwb/tests/test_classes.py +++ b/src/pynwb/tests/test_classes.py @@ -457,12 +457,16 @@ def test_constructor_add_row_minimal(self): ct = ChannelsTable( description="Test channels table", probe=probe, + target_tables={ + "contact": probe.probe_model.contacts_table, + }, ) - ct.add_row() - ct.add_row() + ct.add_row(contact=0) + ct.add_row(contact=1) assert len(ct) == 2 assert ct.id.data == [0, 1] + assert ct["contact"].data == [0, 1] def test_constructor_add_row(self): """Test that the constructor for ChannelsTable sets values as expected.""" @@ -611,10 +615,13 @@ def test_constructor(self): name="Neuropixels1ChannelsTable", description="Test channels table", probe=probe, + target_tables={ + "contact": probe.probe_model.contacts_table, + }, ) - ct.add_row() - ct.add_row() - ct.add_row() + ct.add_row(contact=0) + ct.add_row(contact=1) + ct.add_row(contact=2) channels = DynamicTableRegion( name="channels", # NOTE: this must be named "channels" when used in ExtracellularSeries @@ -661,10 +668,13 @@ def addContainer(self): name="Neuropixels1ChannelsTable", description="Test channels table", probe=probe, + target_tables={ + "contact": probe.probe_model.contacts_table, + }, ) - ct.add_row() - ct.add_row() - ct.add_row() + ct.add_row(contact=0) + ct.add_row(contact=1) + ct.add_row(contact=2) # put this in nwbfile.acquisition for testing self.nwbfile.add_acquisition(ct) diff --git a/src/spec/create_extension_spec.py b/src/spec/create_extension_spec.py index 64700cd..1819bcd 100644 --- a/src/spec/create_extension_spec.py +++ b/src/spec/create_extension_spec.py @@ -56,7 +56,7 @@ def main(): "(first element), which direction is positive in the y direction (second element), etc." ), dtype="text", - required=False, # TODO should this be required? + required=False, ) ], ), @@ -108,6 +108,7 @@ def main(): neurodata_type_inc="VectorData", doc="Shape of the contact; e.g. 'circle'", dtype="text", + quantity="?", ), NWBDatasetSpec( name="radius_in_um", @@ -315,7 +316,6 @@ def main(): name="contact", neurodata_type_inc="DynamicTableRegion", doc="The row in a ContactsTable that represents the contact used as a channel.", - quantity="?", # TODO should this be optional? ), NWBDatasetSpec( name="reference_contact",