mnnpy icon indicating copy to clipboard operation
mnnpy copied to clipboard

Taking len of `None` when passing matrices instead of anndata

Open scottgigante opened this issue 5 years ago • 1 comments

The default value of var_index is None, but the first thing you do with it if the data is not AnnData is take the len. https://github.com/chriscainx/mnnpy/blob/master/mnnpy/mnn.py#L148

>>> import numpy as np
>>> X = np.zeros((10, 100))
>>> Y = np.ones((10, 100))
>>> mnnpy.mnn_correct(X, Y)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Acer\AppData\Roaming\Python\Python37\site-packages\mnnpy\mnn.py", line 148, in mnn_correct
    if len(var_index) != n_cols:
TypeError: object of type 'NoneType' has no len()

scottgigante avatar Jun 26 '20 17:06 scottgigante

I found this bug too.

Kevis9 avatar Oct 29 '22 04:10 Kevis9