当前位置: 首页>>代码示例>>Python>>正文


Python Segment.spikes方法代码示例

本文整理汇总了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)
开发者ID:ChrisNolan1992,项目名称:python-neo,代码行数:29,代码来源:test_spike.py

示例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)
开发者ID:NeuroArchive,项目名称:python-neo,代码行数:41,代码来源:test_spike.py


注:本文中的neo.core.Segment.spikes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。