don't propogate sympy in robustness if unnecessary

This commit is contained in:
Marcell Vazquez-Chanlatte 2017-03-01 14:30:45 -08:00
parent 99e0995287
commit 8b2a114826
2 changed files with 7 additions and 3 deletions

View file

@ -66,5 +66,7 @@ def eval_terms(lineq, x, t):
def eval_term(x, t):
# TODO(lift interpolation much higher)
return lambda term: term.coeff*np.interp(t, x.index, x[term.id.name])
def _eval_term(term):
coeff = float(term.coeff) if term.coeff.is_number else term.coeff
return coeff*np.interp(t, x.index, x[term.id.name])
return _eval_term