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