MCPcopy Create free account
hub / github.com/numpy/numpy / setup

Method setup

benchmarks/benchmarks/bench_indexing.py:18–30  ·  view source on GitHub ↗
(self, dtype, indexes, sel, op)

Source from the content-addressed store, hash-verified

16 param_names = ['dtype', 'indexes', 'sel', 'op']
17
18 def setup(self, dtype, indexes, sel, op):
19 sel = sel.replace('I', indexes)
20
21 ns = {'a': get_square_(dtype),
22 'np': np,
23 'indexes_': get_indexes_(),
24 'indexes_rand_': get_indexes_rand_()}
25
26 code = "def run():\n a[%s]%s"
27 code = code % (sel, op)
28
29 exec(code, ns)
30 self.func = ns['run']
31
32 def time_op(self, dtype, indexes, sel, op):
33 self.func()

Callers

nothing calls this directly

Calls 4

get_square_Function · 0.85
get_indexes_Function · 0.85
get_indexes_rand_Function · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected