diff --git a/doc/source/images/generate_diagram.py b/doc/source/images/generate_diagram.py index 3bf873f5c..1168fb637 100644 --- a/doc/source/images/generate_diagram.py +++ b/doc/source/images/generate_diagram.py @@ -29,7 +29,6 @@ def get_rect_height(name, obj): nlines += len(getattr(obj, '_all_attrs', [])) nlines += len(getattr(obj, '_single_child_objects', [])) nlines += len(getattr(obj, '_multi_child_objects', [])) - nlines += len(getattr(obj, '_multi_parent_objects', [])) return nlines * line_heigth @@ -100,8 +99,7 @@ def generate_diagram(filename, rect_pos, rect_width, figsize): for name, pos in rect_pos.items(): htotal = all_h[name] obj = objs[name] - allrelationship = (list(getattr(obj, '_child_containers', [])) - + list(getattr(obj, '_multi_parent_containers', []))) + allrelationship = list(getattr(obj, '_child_containers', [])) rect = Rectangle(pos, rect_width, htotal, facecolor='w', edgecolor='k', linewidth=2.) @@ -123,8 +121,7 @@ def generate_diagram(filename, rect_pos, rect_width, figsize): ax.add_patch(rect) # multi relationship - relationship = (list(getattr(obj, '_multi_child_objects', [])) - + list(getattr(obj, '_multi_parent_containers', []))) + relationship = list(getattr(obj, '_multi_child_objects', [])) pos2 = (pos[1] + htotal - line_heigth * (1.5 + len(relationship)) - rect_height) rect_height = len(relationship) * line_heigth diff --git a/neo/core/analogsignal.py b/neo/core/analogsignal.py index 476b732c2..ac47834a3 100644 --- a/neo/core/analogsignal.py +++ b/neo/core/analogsignal.py @@ -160,8 +160,8 @@ class AnalogSignal(BaseSignal): ''' - _single_parent_objects = ('Segment', 'ChannelIndex') - _single_parent_attrs = ('segment', 'channel_index') + _parent_objects = ('Segment', 'ChannelIndex') + _parent_attrs = ('segment', 'channel_index') _quantity_attr = 'signal' _necessary_attrs = (('signal', pq.Quantity, 2), ('sampling_rate', pq.Quantity, 0), diff --git a/neo/core/baseneo.py b/neo/core/baseneo.py index f9e2120d6..bf92d8ee9 100644 --- a/neo/core/baseneo.py +++ b/neo/core/baseneo.py @@ -18,12 +18,6 @@ Number, Decimal, np.number, np.bool_) -# handle both Python 2 and Python 3 -try: - ALLOWED_ANNOTATION_TYPES += (long, unicode) -except NameError: - pass - logger = logging.getLogger("Neo") @@ -179,20 +173,13 @@ class BaseNeo: and also sets up the :attr:`annotations` dict for additional arguments. Each class can define one or more of the following class attributes: - :_single_parent_objects: Neo objects that can be parents of this - object. This attribute is used in cases where - only one parent of this class is allowed. - An instance attribute named - class.__name__.lower() will be automatically - defined to hold this parent and will be - initialized to None. - :_multi_parent_objects: Neo objects that can be parents of this - object. This attribute is used in cases where - multiple parents of this class is allowed. - An instance attribute named - class.__name__.lower()+'s' will be - automatically defined to hold this parent and - will be initialized to an empty list. + :_parent_objects: Neo objects that can be parents of this + object. Note that no Neo object can have + more than one parent. + An instance attribute named + class.__name__.lower() will be automatically + defined to hold this parent and will be + initialized to None. :_necessary_attrs: A list of tuples containing the attributes that the class must have. The tuple can have 2-4 elements. The first element is the attribute name. @@ -210,15 +197,8 @@ class must have. The tuple can have 2-4 elements. pretty-printing using iPython. The following helper properties are available: - :_parent_objects: All parent objects. - :_single_parent_objects: + :_multi_parent_objects: - :_single_parent_containers: The names of the container attributes used - to store :_single_parent_objects: - :_multi_parent_containers: The names of the container attributes used - to store :_multi_parent_objects: - :_parent_containers: All parent container attributes. - :_single_parent_containers: + - :_multi_parent_containers: + :_parent_containers: The names of the container attributes used + to store :_parent_objects: :parents: All objects that are parents of the current object. :_all_attrs: All required and optional attributes. :_necessary_attrs: + :_recommended_attrs: @@ -264,11 +244,9 @@ class attributes. :_recommended_attrs: should append # these attributes control relationships, they need to be # specified in each child class # Parent objects whose children can have a single parent - _single_parent_objects = () - # Attribute names corresponding to _single_parent_objects - _single_parent_attrs = () - # Parent objects whose children can have multiple parents - _multi_parent_objects = () + _parent_objects = () + # Attribute names corresponding to _parent_objects + _parent_attrs = () # Attributes that an instance is required to have defined _necessary_attrs = () @@ -298,10 +276,8 @@ def __init__(self, name=None, description=None, file_origin=None, self.file_origin = file_origin # initialize parent containers - for parent in self._single_parent_containers: + for parent in self._parent_containers: setattr(self, parent, None) - for parent in self._multi_parent_containers: - setattr(self, parent, []) def annotate(self, **annotations): """ @@ -341,46 +317,21 @@ def _repr_pretty_(self, pp, cycle): pp.breakable() self._repr_pretty_attrs_(pp, cycle) - @property - def _single_parent_containers(self): - """ - Containers for parent objects whose children can have a single parent. - """ - return tuple([_reference_name(parent) for parent in - self._single_parent_objects]) - - @property - def _multi_parent_containers(self): - """ - Containers for parent objects whose children can have multiple parents. - """ - return tuple([_container_name(parent) for parent in - self._multi_parent_objects]) - - @property - def _parent_objects(self): - """ - All types for parent objects. - """ - return self._single_parent_objects + self._multi_parent_objects - @property def _parent_containers(self): """ - All containers for parent objects. + Containers for parent objects. """ - return self._single_parent_containers + self._multi_parent_containers + return tuple([_reference_name(parent) for parent in + self._parent_objects]) @property def parents(self): """ All parent objects storing the current object. """ - single = [getattr(self, attr) for attr in - self._single_parent_containers] - multi = [list(getattr(self, attr)) for attr in - self._multi_parent_containers] - return tuple(single + sum(multi, [])) + return tuple([getattr(self, attr) for attr in + self._parent_containers]) @property def _all_attrs(self): @@ -420,9 +371,9 @@ def set_parent(self, obj): Set the appropriate "parent" attribute of this object according to the type of "obj" """ - if obj.__class__.__name__ not in self._single_parent_objects: + if obj.__class__.__name__ not in self._parent_objects: raise TypeError("{} can only have parents of type {}, not {}".format( - self.__class__.__name__, self._single_parent_objects, obj.__class__.__name__)) - loc = self._single_parent_objects.index(obj.__class__.__name__) - parent_attr = self._single_parent_attrs[loc] + self.__class__.__name__, self._parent_objects, obj.__class__.__name__)) + loc = self._parent_objects.index(obj.__class__.__name__) + parent_attr = self._parent_attrs[loc] setattr(self, parent_attr, obj) diff --git a/neo/core/channelindex.py b/neo/core/channelindex.py index c15a843f0..14dd31d32 100644 --- a/neo/core/channelindex.py +++ b/neo/core/channelindex.py @@ -154,7 +154,7 @@ class ChannelIndex(Container): _container_child_objects = ('Unit',) _data_child_objects = ('AnalogSignal', 'IrregularlySampledSignal') - _single_parent_objects = ('Block',) + _parent_objects = ('Block',) _necessary_attrs = (('index', np.ndarray, 1, np.dtype('i')),) _recommended_attrs = ((('channel_names', np.ndarray, 1, np.dtype('U')), ('channel_ids', np.ndarray, 1, np.dtype('i')), diff --git a/neo/core/dataobject.py b/neo/core/dataobject.py index 6fe687591..59d287a71 100644 --- a/neo/core/dataobject.py +++ b/neo/core/dataobject.py @@ -357,7 +357,7 @@ def __deepcopy__(self, memo): # thus creating a lot of overhead # But keeping the reference to the same parent is not desired either, because this would be unidirectional # When deepcopying top-down, e.g. a whole block, the links will be handled by the parent - if k in self._single_parent_attrs: + if k in self._parent_attrs: setattr(new_obj, k, None) continue try: diff --git a/neo/core/epoch.py b/neo/core/epoch.py index 092c58d51..95c68aff7 100644 --- a/neo/core/epoch.py +++ b/neo/core/epoch.py @@ -72,8 +72,8 @@ class Epoch(DataObject): ''' - _single_parent_objects = ('Segment',) - _single_parent_attrs = ('segment',) + _parent_objects = ('Segment',) + _parent_attrs = ('segment',) _quantity_attr = 'times' _necessary_attrs = (('times', pq.Quantity, 1), ('durations', pq.Quantity, 1), ('labels', np.ndarray, 1, np.dtype('U'))) diff --git a/neo/core/event.py b/neo/core/event.py index 615860453..b0a765b12 100644 --- a/neo/core/event.py +++ b/neo/core/event.py @@ -65,8 +65,8 @@ class Event(DataObject): ''' - _single_parent_objects = ('Segment',) - _single_parent_attrs = ('segment',) + _parent_objects = ('Segment',) + _parent_attrs = ('segment',) _quantity_attr = 'times' _necessary_attrs = (('times', pq.Quantity, 1), ('labels', np.ndarray, 1, np.dtype('U'))) diff --git a/neo/core/group.py b/neo/core/group.py index 22cfc848d..7e88e81bf 100644 --- a/neo/core/group.py +++ b/neo/core/group.py @@ -42,7 +42,7 @@ class Group(Container): 'Event', 'Epoch', 'ChannelView', 'ImageSequence' ) _container_child_objects = ('Segment', 'Group') - _single_parent_objects = ('Block',) + _parent_objects = ('Block',) def __init__(self, objects=None, name=None, description=None, file_origin=None, allowed_types=None, **annotations): diff --git a/neo/core/imagesequence.py b/neo/core/imagesequence.py index 5fd929ff4..e0ecbc311 100644 --- a/neo/core/imagesequence.py +++ b/neo/core/imagesequence.py @@ -86,8 +86,8 @@ class ImageSequence(BaseSignal): (:attr:`t_start` + :attr:`duration`) """ - _single_parent_objects = ("Segment",) - _single_parent_attrs = ("segment",) + _parent_objects = ("Segment",) + _parent_attrs = ("segment",) _quantity_attr = "image_data" _necessary_attrs = ( ("image_data", pq.Quantity, 3), diff --git a/neo/core/irregularlysampledsignal.py b/neo/core/irregularlysampledsignal.py index e0f5a79b0..609fa01de 100644 --- a/neo/core/irregularlysampledsignal.py +++ b/neo/core/irregularlysampledsignal.py @@ -123,8 +123,8 @@ class IrregularlySampledSignal(BaseSignal): ''' - _single_parent_objects = ('Segment', 'ChannelIndex') - _single_parent_attrs = ('segment', 'channel_index') + _parent_objects = ('Segment', 'ChannelIndex') + _parent_attrs = ('segment', 'channel_index') _quantity_attr = 'signal' _necessary_attrs = (('times', pq.Quantity, 1), ('signal', pq.Quantity, 2)) diff --git a/neo/core/segment.py b/neo/core/segment.py index a2b534e9e..20f87f15e 100644 --- a/neo/core/segment.py +++ b/neo/core/segment.py @@ -75,7 +75,7 @@ class Segment(Container): _data_child_objects = ('AnalogSignal', 'Epoch', 'Event', 'IrregularlySampledSignal', 'SpikeTrain', 'ImageSequence') - _single_parent_objects = ('Block',) + _parent_objects = ('Block',) _recommended_attrs = ((('file_datetime', datetime), ('rec_datetime', datetime), ('index', int)) + diff --git a/neo/core/spiketrain.py b/neo/core/spiketrain.py index f6a63ca64..58303d2af 100644 --- a/neo/core/spiketrain.py +++ b/neo/core/spiketrain.py @@ -199,8 +199,8 @@ class SpikeTrain(DataObject): ''' - _single_parent_objects = ('Segment', 'Unit') - _single_parent_attrs = ('segment', 'unit') + _parent_objects = ('Segment', 'Unit') + _parent_attrs = ('segment', 'unit') _quantity_attr = 'times' _necessary_attrs = (('times', pq.Quantity, 1), ('t_start', pq.Quantity, 0), ('t_stop', pq.Quantity, 0)) diff --git a/neo/core/unit.py b/neo/core/unit.py index 19f068d81..2dceff365 100644 --- a/neo/core/unit.py +++ b/neo/core/unit.py @@ -56,7 +56,7 @@ class Unit(Container): ''' _data_child_objects = ('SpikeTrain',) - _single_parent_objects = ('ChannelIndex',) + _parent_objects = ('ChannelIndex',) _recommended_attrs = Container._recommended_attrs def __init__(self, name=None, description=None, file_origin=None, diff --git a/neo/core/view.py b/neo/core/view.py index b42d17463..1254b909a 100644 --- a/neo/core/view.py +++ b/neo/core/view.py @@ -30,8 +30,8 @@ class ChannelView(BaseNeo): Note: Any other additional arguments are assumed to be user-specific metadata and stored in :attr:`annotations`. """ - _single_parent_objects = ('Segment',) - _single_parent_attrs = ('segment',) + _parent_objects = ('Segment',) + _parent_attrs = ('segment',) _necessary_attrs = ( ('index', np.ndarray, 1, np.dtype('i')), ('obj', ('AnalogSignal', 'IrregularlySampledSignal'), 1) diff --git a/neo/io/proxyobjects.py b/neo/io/proxyobjects.py index 820b9a067..1059b2918 100644 --- a/neo/io/proxyobjects.py +++ b/neo/io/proxyobjects.py @@ -80,7 +80,7 @@ class AnalogSignalProxy(BaseProxy): >>> some_channel_of_anasig = proxy_anasig.load(channel_indexes=[0,5,10]) ''' - _single_parent_objects = ('Segment', 'ChannelIndex') + _parent_objects = ('Segment', 'ChannelIndex') _necessary_attrs = (('sampling_rate', pq.Quantity, 0), ('t_start', pq.Quantity, 0)) _recommended_attrs = BaseNeo._recommended_attrs @@ -287,7 +287,7 @@ class SpikeTrainProxy(BaseProxy): ''' - _single_parent_objects = ('Segment', 'Unit') + _parent_objects = ('Segment', 'Unit') _quantity_attr = 'times' _necessary_attrs = (('t_start', pq.Quantity, 0), ('t_stop', pq.Quantity, 0)) @@ -385,7 +385,7 @@ def load(self, time_slice=None, strict_slicing=True, class _EventOrEpoch(BaseProxy): - _single_parent_objects = ('Segment',) + _parent_objects = ('Segment',) _quantity_attr = 'times' def __init__(self, rawio=None, event_channel_index=None, block_index=0, seg_index=0): diff --git a/neo/test/coretest/test_analogsignal.py b/neo/test/coretest/test_analogsignal.py index de16b9ede..4212a5b75 100644 --- a/neo/test/coretest/test_analogsignal.py +++ b/neo/test/coretest/test_analogsignal.py @@ -339,11 +339,9 @@ def test__children(self): chx.analogsignals = [signal] chx.create_many_to_one_relationship() - self.assertEqual(signal._single_parent_objects, ('Segment', 'ChannelIndex')) - self.assertEqual(signal._multi_parent_objects, ()) + self.assertEqual(signal._parent_objects, ('Segment', 'ChannelIndex')) - self.assertEqual(signal._single_parent_containers, ('segment', 'channel_index')) - self.assertEqual(signal._multi_parent_containers, ()) + self.assertEqual(signal._parent_containers, ('segment', 'channel_index')) self.assertEqual(signal._parent_objects, ('Segment', 'ChannelIndex')) self.assertEqual(signal._parent_containers, ('segment', 'channel_index')) diff --git a/neo/test/coretest/test_base.py b/neo/test/coretest/test_base.py index bd7b010db..14d4325d2 100644 --- a/neo/test/coretest/test_base.py +++ b/neo/test/coretest/test_base.py @@ -116,11 +116,9 @@ def test_annotate(self): def test__children(self): base = BaseNeo() - self.assertEqual(base._single_parent_objects, ()) - self.assertEqual(base._multi_parent_objects, ()) + self.assertEqual(base._parent_objects, ()) - self.assertEqual(base._single_parent_containers, ()) - self.assertEqual(base._multi_parent_containers, ()) + self.assertEqual(base._parent_containers, ()) self.assertEqual(base._parent_objects, ()) self.assertEqual(base._parent_containers, ()) diff --git a/neo/test/coretest/test_block.py b/neo/test/coretest/test_block.py index 9e2b3c397..c7a4853f7 100644 --- a/neo/test/coretest/test_block.py +++ b/neo/test/coretest/test_block.py @@ -258,9 +258,8 @@ def test__children(self): self.assertEqual(self.blk1._container_child_objects, ('Segment', 'ChannelIndex', 'Group')) self.assertEqual(self.blk1._data_child_objects, ()) - self.assertEqual(self.blk1._single_parent_objects, ()) + self.assertEqual(self.blk1._parent_objects, ()) self.assertEqual(self.blk1._multi_child_objects, ()) - self.assertEqual(self.blk1._multi_parent_objects, ()) self.assertEqual(self.blk1._child_properties, ('Unit',)) @@ -272,9 +271,8 @@ def test__children(self): self.assertEqual(self.blk1._data_child_containers, ()) self.assertEqual(self.blk1._single_child_containers, ('segments', 'channel_indexes', 'groups')) - self.assertEqual(self.blk1._single_parent_containers, ()) + self.assertEqual(self.blk1._parent_containers, ()) self.assertEqual(self.blk1._multi_child_containers, ()) - self.assertEqual(self.blk1._multi_parent_containers, ()) self.assertEqual(self.blk1._child_objects, ('Segment', 'ChannelIndex', 'Group')) diff --git a/neo/test/coretest/test_channelindex.py b/neo/test/coretest/test_channelindex.py index 7a4b06fe5..05a0e4ab5 100644 --- a/neo/test/coretest/test_channelindex.py +++ b/neo/test/coretest/test_channelindex.py @@ -218,9 +218,8 @@ def test__children(self): self.assertEqual(self.chx1._container_child_objects, ('Unit',)) self.assertEqual(self.chx1._data_child_objects, ('AnalogSignal', 'IrregularlySampledSignal')) - self.assertEqual(self.chx1._single_parent_objects, ('Block',)) + self.assertEqual(self.chx1._parent_objects, ('Block',)) self.assertEqual(self.chx1._multi_child_objects, tuple()) - self.assertEqual(self.chx1._multi_parent_objects, ()) self.assertEqual(self.chx1._child_properties, ()) self.assertEqual(self.chx1._single_child_objects, @@ -231,10 +230,9 @@ def test__children(self): ('analogsignals', 'irregularlysampledsignals')) self.assertEqual(self.chx1._single_child_containers, ('units', 'analogsignals', 'irregularlysampledsignals')) - self.assertEqual(self.chx1._single_parent_containers, ('block',)) + self.assertEqual(self.chx1._parent_containers, ('block',)) self.assertEqual(self.chx1._multi_child_containers, tuple()) - self.assertEqual(self.chx1._multi_parent_containers, ()) self.assertEqual(self.chx1._child_objects, ('Unit', 'AnalogSignal', 'IrregularlySampledSignal')) diff --git a/neo/test/coretest/test_container.py b/neo/test/coretest/test_container.py index d156a896b..99296b197 100644 --- a/neo/test/coretest/test_container.py +++ b/neo/test/coretest/test_container.py @@ -47,11 +47,9 @@ def test_init(self): def test__children(self): container = Container() - self.assertEqual(container._single_parent_objects, ()) - self.assertEqual(container._multi_parent_objects, ()) + self.assertEqual(container._parent_objects, ()) - self.assertEqual(container._single_parent_containers, ()) - self.assertEqual(container._multi_parent_containers, ()) + self.assertEqual(container._parent_containers, ()) self.assertEqual(container._parent_objects, ()) self.assertEqual(container._parent_containers, ()) diff --git a/neo/test/coretest/test_epoch.py b/neo/test/coretest/test_epoch.py index c2c7935bb..a8c952b66 100644 --- a/neo/test/coretest/test_epoch.py +++ b/neo/test/coretest/test_epoch.py @@ -262,11 +262,9 @@ def test__children(self): segment.epochs = [epc] segment.create_many_to_one_relationship() - self.assertEqual(epc._single_parent_objects, ('Segment',)) - self.assertEqual(epc._multi_parent_objects, ()) + self.assertEqual(epc._parent_objects, ('Segment',)) - self.assertEqual(epc._single_parent_containers, ('segment',)) - self.assertEqual(epc._multi_parent_containers, ()) + self.assertEqual(epc._parent_containers, ('segment',)) self.assertEqual(epc._parent_objects, ('Segment',)) self.assertEqual(epc._parent_containers, ('segment',)) diff --git a/neo/test/coretest/test_event.py b/neo/test/coretest/test_event.py index db85048ac..c11dbde05 100644 --- a/neo/test/coretest/test_event.py +++ b/neo/test/coretest/test_event.py @@ -523,11 +523,9 @@ def test__children(self): segment.events = [evt] segment.create_many_to_one_relationship() - self.assertEqual(evt._single_parent_objects, ('Segment',)) - self.assertEqual(evt._multi_parent_objects, ()) + self.assertEqual(evt._parent_objects, ('Segment',)) - self.assertEqual(evt._single_parent_containers, ('segment',)) - self.assertEqual(evt._multi_parent_containers, ()) + self.assertEqual(evt._parent_containers, ('segment',)) self.assertEqual(evt._parent_objects, ('Segment',)) self.assertEqual(evt._parent_containers, ('segment',)) diff --git a/neo/test/coretest/test_segment.py b/neo/test/coretest/test_segment.py index b2d87c5a1..a0784a7fa 100644 --- a/neo/test/coretest/test_segment.py +++ b/neo/test/coretest/test_segment.py @@ -310,18 +310,16 @@ def test__children(self): 'imagesequences') self.assertEqual(self.seg1._container_child_objects, ()) self.assertEqual(self.seg1._data_child_objects, childobjs) - self.assertEqual(self.seg1._single_parent_objects, ('Block',)) + self.assertEqual(self.seg1._parent_objects, ('Block',)) self.assertEqual(self.seg1._multi_child_objects, ()) - self.assertEqual(self.seg1._multi_parent_objects, ()) self.assertEqual(self.seg1._child_properties, ()) self.assertEqual(self.seg1._single_child_objects, childobjs) self.assertEqual(self.seg1._container_child_containers, ()) self.assertEqual(self.seg1._data_child_containers, childconts) self.assertEqual(self.seg1._single_child_containers, childconts) - self.assertEqual(self.seg1._single_parent_containers, ('block',)) + self.assertEqual(self.seg1._parent_containers, ('block',)) self.assertEqual(self.seg1._multi_child_containers, ()) - self.assertEqual(self.seg1._multi_parent_containers, ()) self.assertEqual(self.seg1._child_objects, childobjs) self.assertEqual(self.seg1._child_containers, childconts) diff --git a/neo/test/coretest/test_spiketrain.py b/neo/test/coretest/test_spiketrain.py index 9f8c8b344..9544e320e 100644 --- a/neo/test/coretest/test_spiketrain.py +++ b/neo/test/coretest/test_spiketrain.py @@ -2054,11 +2054,9 @@ def test__children(self): unit.spiketrains = [self.train1] unit.create_many_to_one_relationship() - self.assertEqual(self.train1._single_parent_objects, ('Segment', 'Unit')) - self.assertEqual(self.train1._multi_parent_objects, ()) + self.assertEqual(self.train1._parent_objects, ('Segment', 'Unit')) - self.assertEqual(self.train1._single_parent_containers, ('segment', 'unit')) - self.assertEqual(self.train1._multi_parent_containers, ()) + self.assertEqual(self.train1._parent_containers, ('segment', 'unit')) self.assertEqual(self.train1._parent_objects, ('Segment', 'Unit')) self.assertEqual(self.train1._parent_containers, ('segment', 'unit')) diff --git a/neo/test/coretest/test_unit.py b/neo/test/coretest/test_unit.py index 4919fdcf5..bf0a29efc 100644 --- a/neo/test/coretest/test_unit.py +++ b/neo/test/coretest/test_unit.py @@ -144,10 +144,9 @@ def test__children(self): self.assertEqual(self.unit1._container_child_objects, ()) self.assertEqual(self.unit1._data_child_objects, ('SpikeTrain',)) - self.assertEqual(self.unit1._single_parent_objects, + self.assertEqual(self.unit1._parent_objects, ('ChannelIndex',)) self.assertEqual(self.unit1._multi_child_objects, ()) - self.assertEqual(self.unit1._multi_parent_objects, ()) self.assertEqual(self.unit1._child_properties, ()) self.assertEqual(self.unit1._single_child_objects, ('SpikeTrain',)) @@ -155,10 +154,9 @@ def test__children(self): self.assertEqual(self.unit1._container_child_containers, ()) self.assertEqual(self.unit1._data_child_containers, ('spiketrains',)) self.assertEqual(self.unit1._single_child_containers, ('spiketrains',)) - self.assertEqual(self.unit1._single_parent_containers, + self.assertEqual(self.unit1._parent_containers, ('channel_index',)) self.assertEqual(self.unit1._multi_child_containers, ()) - self.assertEqual(self.unit1._multi_parent_containers, ()) self.assertEqual(self.unit1._child_objects, ('SpikeTrain',)) self.assertEqual(self.unit1._child_containers, ('spiketrains',))