Documentation, type(x) == np.ndarray --> isinstance(x,np.ndarray), and Model (untested.)

This commit is contained in:
rowanc1
2014-05-17 16:50:51 -07:00
parent b33ec1828c
commit 063c84af91
15 changed files with 84 additions and 63 deletions
+2 -2
View File
@@ -140,14 +140,14 @@ def isScalar(f):
scalarTypes = [float, int, long, np.float_, np.int_]
if type(f) in scalarTypes:
return True
elif type(f) == np.ndarray and f.size == 1 and type(f[0]) in scalarTypes:
elif isinstance(f, np.ndarray) and f.size == 1 and type(f[0]) in scalarTypes:
return True
return False
def asArray_N_x_Dim(pts, dim):
if type(pts) == list:
pts = np.array(pts)
assert type(pts) == np.ndarray, "pts must be a numpy array"
assert isinstance(pts, np.ndarray), "pts must be a numpy array"
if dim > 1:
pts = np.atleast_2d(pts)