diff options
-rw-r--r-- | interp.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -101,6 +101,15 @@ class Interp2D_C: self._ret_c = ctypes.cast(np.ctypeslib.as_ctypes(self._ret), _doubleptr) def interp(self, x, y): + try: + x.shape[0] + except (AttributeError, IndexError): + x = np.array([x]) + try: + y.shape[0] + except (AttributeError, IndexError): + y = np.array([y]) + if x.shape != self._x.shape: self._setup_arrays(x.shape) |