当前位置: 首页>>代码示例>>Python>>正文


Python Coverage.printCoverage方法代码示例

本文整理汇总了Python中coverage.Coverage.printCoverage方法的典型用法代码示例。如果您正苦于以下问题:Python Coverage.printCoverage方法的具体用法?Python Coverage.printCoverage怎么用?Python Coverage.printCoverage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在coverage.Coverage的用法示例。


在下文中一共展示了Coverage.printCoverage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

# 需要导入模块: from coverage import Coverage [as 别名]
# 或者: from coverage.Coverage import printCoverage [as 别名]
    if len(sys.argv) > 5:
       costsFilename = sys.argv[5];
       with open(costsFilename, "rb") as f:
          first = f.readline()     # Read the first line.
          f.seek(-2, 2)            # Jump to the second last byte.
          while f.read(1) != "\n": # Until EOL is found...
             f.seek(-2, 1)        # ...jump back the read byte plus one more.
          last = f.readline()      # Read last line.
       if first:  # if not empty string
          emptyModelCost = int(first.split(' ')[-1].rstrip()); # Get the cost of the empty model from the first line
       if last:   # if not empty string
          finalModelCost = int(last.split('\t')[-1].rstrip());  # Get the final cost of the selected model
    """
       

    # Find statistics about the summaries
    print "Total\tfc\tst\tbc\tch\tnc\tnb\tEmpty\tModel\tPercent"
    print "%.0f\t%.0f\t%.0f\t%.0f\t%.0f\t%.0f\t%.0f\t%.0f\t%.0f\t%.2f%%\n" % (m.numStructs, m.numFullCliques, m.numStars, m.numBiPartiteCores, m.numChains, m.numNearCliques, m.numNearBiPartiteCores, emptyModelCost, finalModelCost, 100.0*finalModelCost/emptyModelCost)

# Compute print entropy
structEntropy = entropy.entropy_single([m.numStructs, m.numFullCliques, m.numStars, m.numBiPartiteCores, m.numChains])
print 'Entropy over structure type: ' + str(structEntropy)

print time()-t0    
print "Total running time %.2f" % (time()-t0);

gdfhandle.close()
gmlhandle.close()

c.printCoverage();
开发者ID:yikeliu,项目名称:supergraph-analysis,代码行数:32,代码来源:parse_graph.py


注:本文中的coverage.Coverage.printCoverage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。