Skip to content
Snippets Groups Projects
Commit 6522afff authored by jack-parsons's avatar jack-parsons
Browse files

Fixing newShape type and length check

parent 3bf2a704
No related branches found
No related tags found
1 merge request!23Merge in Jack's changes
Pipeline #872 passed
......@@ -132,8 +132,9 @@ class pca(object):
to standard deviations about the mean
"""
sfs = np.array(sfs)
if not sfs.shape == self.pc_stdevs.shape:
if isinstance(sfs, (list, tuple, np.ndarray)):
raise TypeError('sfs is invalid type (expected array-like, found: {}'.format(type(sfs)))
if len(sfs) != len(self.pc_stdevs.shape):
raise ValueError('sfs must be of the same length as the number of '
'principal components (expected {} but found {})'.format(self.pc_stdevs.shape, sfs.shape))
if scale == 'eigs':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment