本文整理匯總了Python中neo.core.event.Event.create_relationship方法的典型用法代碼示例。如果您正苦於以下問題:Python Event.create_relationship方法的具體用法?Python Event.create_relationship怎麽用?Python Event.create_relationship使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類neo.core.event.Event
的用法示例。
在下文中一共展示了Event.create_relationship方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test__children
# 需要導入模塊: from neo.core.event import Event [as 別名]
# 或者: from neo.core.event.Event import create_relationship [as 別名]
def test__children(self):
params = {'testarg2': 'yes', 'testarg3': True}
evt = Event(1.5*pq.ms,
label='test epoch', name='test', description='tester',
file_origin='test.file',
testarg1=1, **params)
evt.annotate(testarg1=1.1, testarg0=[1, 2, 3])
assert_neo_object_is_compliant(evt)
segment = Segment(name='seg1')
segment.events = [evt]
segment.create_many_to_one_relationship()
self.assertEqual(evt._container_child_objects, ())
self.assertEqual(evt._data_child_objects, ())
self.assertEqual(evt._single_parent_objects, ('Segment',))
self.assertEqual(evt._multi_child_objects, ())
self.assertEqual(evt._multi_parent_objects, ())
self.assertEqual(evt._child_properties, ())
self.assertEqual(evt._single_child_objects, ())
self.assertEqual(evt._container_child_containers, ())
self.assertEqual(evt._data_child_containers, ())
self.assertEqual(evt._single_child_containers, ())
self.assertEqual(evt._single_parent_containers, ('segment',))
self.assertEqual(evt._multi_child_containers, ())
self.assertEqual(evt._multi_parent_containers, ())
self.assertEqual(evt._child_objects, ())
self.assertEqual(evt._child_containers, ())
self.assertEqual(evt._parent_objects, ('Segment',))
self.assertEqual(evt._parent_containers, ('segment',))
self.assertEqual(evt.children, ())
self.assertEqual(len(evt.parents), 1)
self.assertEqual(evt.parents[0].name, 'seg1')
evt.create_many_to_one_relationship()
evt.create_many_to_many_relationship()
evt.create_relationship()
assert_neo_object_is_compliant(evt)