本文整理汇总了Python中neurokernel.pattern.Interface.to_tuples方法的典型用法代码示例。如果您正苦于以下问题:Python Interface.to_tuples方法的具体用法?Python Interface.to_tuples怎么用?Python Interface.to_tuples使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neurokernel.pattern.Interface
的用法示例。
在下文中一共展示了Interface.to_tuples方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_to_tuples_single_level
# 需要导入模块: from neurokernel.pattern import Interface [as 别名]
# 或者: from neurokernel.pattern.Interface import to_tuples [as 别名]
def test_to_tuples_single_level(self):
i = Interface('[0:4]')
i['[0:2]', 'interface'] = 0
i['[2:4]', 'interface'] = 1
self.assertSequenceEqual(i.to_tuples(0),
[(0,), (1,)])
self.assertSequenceEqual(i.to_tuples(),
[(0,), (1,), (2,), (3,)])
示例2: test_to_tuples_multi_levels
# 需要导入模块: from neurokernel.pattern import Interface [as 别名]
# 或者: from neurokernel.pattern.Interface import to_tuples [as 别名]
def test_to_tuples_multi_levels(self):
i = Interface('/foo[0:4]')
i['/foo[0:2]', 'interface'] = 0
i['/foo[2:4]', 'interface'] = 1
self.assertSequenceEqual(i.to_tuples(0),
[('foo', 0),
('foo', 1)])
self.assertSequenceEqual(i.to_tuples(),
[('foo', 0),
('foo', 1),
('foo', 2),
('foo', 3)])