From 2f6c87dd4f70c6f64a91212c6dea4334e9cf2f2c Mon Sep 17 00:00:00 2001 From: "Stephen M. McQuay" Date: Sat, 17 Sep 2011 17:03:07 -0600 Subject: [PATCH] minor: missed a few Answer-related lines, and my logic in baker.interpolate was incorrect --- interp/baker/__init__.py | 2 +- interp/tools.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interp/baker/__init__.py b/interp/baker/__init__.py index bccd4db..3e4d8d7 100644 --- a/interp/baker/__init__.py +++ b/interp/baker/__init__.py @@ -150,7 +150,7 @@ def interpolate(X, R, R_q, S=None, S_q=None, order=2): # calculate values only for the simplex triangle phi, qlin = qlinear(X, R, R_q) - if order in xrange(2, 11) and S: + if order in xrange(2, 11) and S is not None: error_term, abc = get_error(phi, R, R_q, S, S_q, order) # if a pathological vertex configuration was encountered and diff --git a/interp/tools.py b/interp/tools.py index f824b3a..647499e 100644 --- a/interp/tools.py +++ b/interp/tools.py @@ -62,11 +62,11 @@ def scipy_exact_2D(X): def improved_answer(answer, exact): - if not answer['error']: + if not answer.error: # was probably just a linear interpolation return False - if np.abs(answer['final'] - exact) <= np.abs(answer['qlin'] - exact): + if np.abs(answer.final - exact) <= np.abs(answer.qlin - exact): return True else: return False