本文整理汇总了Python中tree.Node.npts方法的典型用法代码示例。如果您正苦于以下问题:Python Node.npts方法的具体用法?Python Node.npts怎么用?Python Node.npts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tree.Node
的用法示例。
在下文中一共展示了Node.npts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testChildren
# 需要导入模块: from tree import Node [as 别名]
# 或者: from tree.Node import npts [as 别名]
def testChildren(self):
head = Node(None, None)
left = Node(head, True)
right = Node(head, False)
self.assertTrue(head.Left == left)
self.assertTrue(head.Right == right)
self.assertTrue(left.Parent == head)
self.assertTrue(right.Parent == head)
self.assertTrue(left.is_left is True)
self.assertTrue(right.is_left is False)
self.assertTrue(head.depth == 0)
self.assertTrue(left.depth == 1)
self.assertTrue(right.depth == 1)
left.ybar = 2.0
left.yvar = 1.0
left.npts = 100
assert(left.ybar == 2.0)
assert(left.yvar == 1.0)
assert(left.npts == 100)
assert(left._ybar == 2.0)
assert(left._yvar == 1.0)
assert(left._npts == 100)