You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseValueError("This dataset does not have a basis to update. Please use `add_basis` to create and initialize the values in the Dataset's basis matrix.")
66
63
ifnotisinstance(basis, np.ndarray):
67
64
raiseValueError("basis must be a numpy array.")
68
-
ifbasis.ndim!=2:
69
-
raiseValueError("basis must be a 2-dimensional numpy array.")
65
+
ifnp.ndim(basis) ==1:
66
+
basis_=np.expand_dims(basis, 1)
67
+
elifnp.ndim(basis) ==2:
68
+
basis_=basis
69
+
else:
70
+
raiseValueError("basis must be a numpy array with one or two dimension.")
71
+
n, p=basis_.shape
72
+
basis_rowmajor=np.ascontiguousarray(basis_)
70
73
ifself.num_basis() !=p:
71
74
raiseValueError(f"The number of columns in the new basis ({p}) must match the number of columns in the existing basis ({self.num_basis()}).")
0 commit comments