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),
评论列表
文章目录