本文整理汇总了Python中neo.core.Segment.spikes方法的典型用法代码示例。如果您正苦于以下问题:Python Segment.spikes方法的具体用法?Python Segment.spikes怎么用?Python Segment.spikes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neo.core.Segment
的用法示例。
在下文中一共展示了Segment.spikes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__children
# 需要导入模块: from neo.core import Segment [as 别名]
# 或者: from neo.core.Segment import spikes [as 别名]
def test__children(self):
segment = Segment(name='seg1')
segment.spikes = [self.spike1]
segment.create_many_to_one_relationship()
unit = Unit(name='unit1')
unit.spikes = [self.spike1]
unit.create_many_to_one_relationship()
self.assertEqual(self.spike1._single_parent_objects,
('Segment', 'Unit'))
self.assertEqual(self.spike1._multi_parent_objects, ())
self.assertEqual(self.spike1._single_parent_containers,
('segment', 'unit'))
self.assertEqual(self.spike1._multi_parent_containers, ())
self.assertEqual(self.spike1._parent_objects,
('Segment', 'Unit'))
self.assertEqual(self.spike1._parent_containers,
('segment', 'unit'))
self.assertEqual(len(self.spike1.parents), 2)
self.assertEqual(self.spike1.parents[0].name, 'seg1')
self.assertEqual(self.spike1.parents[1].name, 'unit1')
assert_neo_object_is_compliant(self.spike1)
示例2: test__children
# 需要导入模块: from neo.core import Segment [as 别名]
# 或者: from neo.core.Segment import spikes [as 别名]
def test__children(self):
segment = Segment(name="seg1")
segment.spikes = [self.spike1]
segment.create_many_to_one_relationship()
unit = Unit(name="unit1")
unit.spikes = [self.spike1]
unit.create_many_to_one_relationship()
self.assertEqual(self.spike1._container_child_objects, ())
self.assertEqual(self.spike1._data_child_objects, ())
self.assertEqual(self.spike1._single_parent_objects, ("Segment", "Unit"))
self.assertEqual(self.spike1._multi_child_objects, ())
self.assertEqual(self.spike1._multi_parent_objects, ())
self.assertEqual(self.spike1._child_properties, ())
self.assertEqual(self.spike1._single_child_objects, ())
self.assertEqual(self.spike1._container_child_containers, ())
self.assertEqual(self.spike1._data_child_containers, ())
self.assertEqual(self.spike1._single_child_containers, ())
self.assertEqual(self.spike1._single_parent_containers, ("segment", "unit"))
self.assertEqual(self.spike1._multi_child_containers, ())
self.assertEqual(self.spike1._multi_parent_containers, ())
self.assertEqual(self.spike1._child_objects, ())
self.assertEqual(self.spike1._child_containers, ())
self.assertEqual(self.spike1._parent_objects, ("Segment", "Unit"))
self.assertEqual(self.spike1._parent_containers, ("segment", "unit"))
self.assertEqual(self.spike1.children, ())
self.assertEqual(len(self.spike1.parents), 2)
self.assertEqual(self.spike1.parents[0].name, "seg1")
self.assertEqual(self.spike1.parents[1].name, "unit1")
self.spike1.create_many_to_one_relationship()
self.spike1.create_many_to_many_relationship()
self.spike1.create_relationship()
assert_neo_object_is_compliant(self.spike1)