<commit_before>"""
Benchmark for fatiando.seis.ttime2d.straight
"""
import timeit
import fatiando as ft

setup = """
import numpy
import fatiando as ft
area = (0, 5, 0, 5)
shape = (30, 30)
model = ft.msh.dd.SquareMesh(area, shape)
model.addprop('vp', numpy.ones(model.size))
src_loc = ft.utils.random_points(area, 40)
rec_loc = ft.utils.circular_points(area, 40, random=True)
srcs, recs = ft.utils.connect_points(src_loc, rec_loc)

"""
n = 3
time = timeit.timeit("ft.seis.ttime2d.straight(model, 'vp', srcs, recs, jobs=None)",
                     setup, number=n)/float(n)
print "Average time of %d runs: %s" % (n, ft.utils.sec2hms(time))
<commit_msg>Fixed broken benchmark for ttime2d.straight<commit_after>"""
Benchmark for fatiando.seis.ttime2d.straight
"""
import timeit
import fatiando as ft

setup = """
import numpy
import fatiando as ft
area = (0, 5, 0, 5)
shape = (30, 30)
model = ft.msh.dd.SquareMesh(area, shape)
model.addprop('vp', numpy.ones(model.size))
src_loc = ft.utils.random_points(area, 40)
rec_loc = ft.utils.circular_points(area, 40, random=True)
srcs, recs = ft.utils.connect_points(src_loc, rec_loc)

"""
n = 3
time = timeit.timeit("ft.seis.ttime2d.straight(model, 'vp', srcs, recs, par=True)",
                     setup, number=n)/float(n)
print "Average time of %d runs: %s" % (n, ft.utils.sec2hms(time))

{'fraction_non_alphanumeric': 0.15828957239309827, 'fraction_numerical': 0.024756189047261814, 'mean_word_length': 4.512396694214876, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3500070', 'n_tokens_mistral': 552, 'n_tokens_neox': 524, 'n_words': 124}