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

Method setup

benchmarks/benchmarks/bench_ufunc.py:170–180  ·  view source on GitHub ↗
(self, methname, npdtypes)

Source from the content-addressed store, hash-verified

168 timeout = 10
169
170 def setup(self, methname, npdtypes):
171 if (
172 npdtypes.startswith("complex")
173 and methname in ["__floordiv__", "__mod__"]
174 ) or (
175 not npdtypes.startswith("int")
176 and methname in ["__and__", "__or__", "__xor__"]
177 ):
178 raise NotImplementedError # skip
179 values = get_squares_().get(npdtypes)
180 self.xargs = [values[0], values[1]]
181
182 def time_ndarray_meth(self, methname, npdtypes):
183 getattr(operator, methname)(*self.xargs)

Callers

nothing calls this directly

Calls 3

get_squares_Function · 0.85
startswithMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected