MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / run_numpy

Function run_numpy

benchmarks/runners/run_py.py:180–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178
179# --------------------------------------------------------------------------- #
180def run_numpy():
181 import numpy as np
182
183 inp = KASE["inputs"]["numpy"]
184 if inp is None:
185 emit(status="unsupported", reason="NumPy has no symbolic algebra")
186 return
187
188 timing = timeit(lambda: eval(inp["expr"], {"np": np}))
189 val = eval(inp["expr"], {"np": np})
190 val = float(val)
191 if not np.isfinite(val):
192 emit(status="overflow", text=repr(val), valueText=repr(val), values=[], **timing)
193 else:
194 # repr() of a float64 round-trips to full ~17 significant digits.
195 emit(status="ok", text=repr(val), valueText=repr(val), values=[], **timing)
196
197
198if TOOL == "sympy":

Callers 1

run_py.pyFile · 0.85

Calls 2

emitFunction · 0.70
timeitFunction · 0.70

Tested by

no test coverage detected