summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interp.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/interp.py b/interp.py
index 9e4049e..c567758 100644
--- a/interp.py
+++ b/interp.py
@@ -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)