ValueError instead of NameError
@@ -81,7 +81,7 @@ def make_dataset(model, theta, cond_vec, n_channel=30, n_sim=1,
elif cond_vec.ndim == 2:
Zcond = cond_vec
else:
- raise NameError("cond_vec needs to be either vector or design matrix")
+ raise ValueError("cond_vec needs to be either vector or design matrix")
n_obs, _ = Zcond.shape
# If signal_cov_channel is given, precalculate the cholesky decomp
@@ -89,7 +89,7 @@ def make_dataset(model, theta, cond_vec, n_channel=30, n_sim=1,
signal_chol_channel = None
else:
if signal_cov_channel.shape is not (n_channel, n_channel):
- raise NameError("Signal covariance for channels needs to be \
+ raise ValueError("Signal covariance for channels needs to be \
n_channel x n_channel array")
signal_chol_channel = np.linalg.cholesky(signal_cov_channel)
@@ -98,7 +98,7 @@ def make_dataset(model, theta, cond_vec, n_channel=30, n_sim=1,
noise_chol_channel = None
else:
if noise_cov_channel.shape is not (n_channel, n_channel):
- raise NameError("noise covariance for channels needs to be \
+ raise ValueError("noise covariance for channels needs to be \
n_channel x n_channel array")
noise_chol_channel = np.linalg.cholesky(noise_cov_channel)
@@ -107,7 +107,7 @@ def make_dataset(model, theta, cond_vec, n_channel=30, n_sim=1,
noise_chol_trial = None
else:
if noise_cov_trial.shape is not (n_channel, n_channel):
- raise NameError("noise covariance for trials needs to be \
+ raise ValueError("noise covariance for trials needs to be \
n_obs x n_obs array")
noise_chol_trial = np.linalg.cholesky(noise_cov_trial)
