本文整理汇总了Python中arelle.ModelRenderingObject.StructuralNode.abstract方法的典型用法代码示例。如果您正苦于以下问题:Python StructuralNode.abstract方法的具体用法?Python StructuralNode.abstract怎么用?Python StructuralNode.abstract使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arelle.ModelRenderingObject.StructuralNode
的用法示例。
在下文中一共展示了StructuralNode.abstract方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cartesianProductExpander
# 需要导入模块: from arelle.ModelRenderingObject import StructuralNode [as 别名]
# 或者: from arelle.ModelRenderingObject.StructuralNode import abstract [as 别名]
def cartesianProductExpander(childStructuralNode, view, depth, axisDisposition, facts, tblAxisRels, i):
if i is not None: # recurse table relationships for cartesian product
for j, tblRel in enumerate(tblAxisRels[i+1:]):
tblObj = tblRel.toModelObject
if isinstance(tblObj, (ModelEuAxisCoord, ModelDefinitionNode)) and axisDisposition == tblRel.axisDisposition:
addBreakdownNode(view, axisDisposition, tblObj)
#if tblObj.cardinalityAndDepth(childStructuralNode)[1] or axisDisposition == "z":
if axisDisposition == "z":
subOrdTblCntx = StructuralNode(childStructuralNode, tblObj, tblObj)
subOrdTblCntx._choiceStructuralNodes = [] # this is a breakdwon node
subOrdTblCntx.indent = 0 # separate breakdown not indented]
depth = 0 # cartesian next z is also depth 0
childStructuralNode.childStructuralNodes.append(subOrdTblCntx)
else: # non-ordinate composition
subOrdTblCntx = childStructuralNode
# predefined axes need facts sub-filtered
if isinstance(childStructuralNode.definitionNode, ModelClosedDefinitionNode):
matchingFacts = childStructuralNode.evaluate(childStructuralNode.definitionNode,
childStructuralNode.definitionNode.filteredFacts,
evalArgs=(facts,))
else:
matchingFacts = facts
# returns whether there were no structural node results
subOrdTblCntx.abstract = True # can't be abstract across breakdown
expandDefinition(view, subOrdTblCntx, tblObj, tblObj,
depth, # depth + (0 if axisDisposition == 'z' else 1),
axisDisposition, matchingFacts, j + i + 1, tblAxisRels) #cartesian product
break