clustering_test.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:eqclustering 作者: NVSeismoLab 项目源码 文件源码
def test_benchmark():
    """Benchmark reading/writing a file and output the time"""
    logging.captureWarnings(True)

    FINPUT = os.path.join(PWD, 'data', 'NSL_catalog_col.txt')
    FOUTPUT = "/tmp/eqclusterng-test-output.txt"

    import time
    t0 = time.time()

    t = BPTree.from_file(FINPUT) # Init tree with events from a file
    t.grow()                # Populate B-P tree with events
    t.prune()               # Prune given cutoff (calculate n if none)
    t.output2file(FOUTPUT)  # Output to file to match MATLAB perf

    t1 = time.time()
    print " bench: {0}eq/{1:.6f}s ".format(len(t.P), t1-t0),
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号