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

Function sample

benchmarks/audit/run_sympy_wester.py:45–53  ·  view source on GitHub ↗
(e, var, pts)

Source from the content-addressed store, hash-verified

43
44
45def sample(e, var, pts):
46 v = symbols(var, real=True) # must match the (real) symbol used to build `e`
47 out = []
48 for p in pts:
49 try:
50 out.append(float(N(e.subs(v, float(p)), 25)))
51 except Exception:
52 out.append(None)
53 return out
54
55
56def main():

Callers 1

mainFunction · 0.70

Calls 3

symbolsFunction · 0.85
subsMethod · 0.65
NFunction · 0.50

Tested by

no test coverage detected