當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。