Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable referenced before assignment in _get_rep #796

Closed
WeilerP opened this issue Jan 4, 2022 · 1 comment
Closed

Variable referenced before assignment in _get_rep #796

WeilerP opened this issue Jan 4, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@WeilerP
Copy link
Member

WeilerP commented Jan 4, 2022

Description

In scvelo/preprocessing/neighbors.py::_get_rep, the variable rep is referenced before assigned when not entering the if-else clause.

import scvelo as scv
from scvelo.preprocessing.neighbors import _get_rep

adata = scv.datasets.pancreas()
use_rep = _get_rep(adata, use_rep="random", n_pcs=None)
Error output
---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
<ipython-input-4-eae99bea90f1> in <module>
      1 adata = scv.datasets.pancreas()
----> 2 use_rep = _get_rep(adata, use_rep="random", n_pcs=None)

~/code/scvelo/scvelo/preprocessing/neighbors.py in _get_rep(adata, use_rep, n_pcs)
     77         )
     78 
---> 79     return rep
     80 
     81 

UnboundLocalError: local variable 'rep' referenced before assignment
Versions
scvelo==0.2.5.dev56+g9ff8098.d20211206  scanpy==1.7.2  anndata==0.7.6  loompy==3.0.6  numpy==1.20.3  scipy==1.6.3  matplotlib==3.4.2  sklearn==0.24.2  pandas==1.2.4
@WeilerP WeilerP added the bug Something isn't working label Jan 4, 2022
@WeilerP WeilerP self-assigned this Jan 4, 2022
@WeilerP WeilerP mentioned this issue Jan 4, 2022
@WeilerP
Copy link
Member Author

WeilerP commented Jan 4, 2022

Closed via #797.

@WeilerP WeilerP closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant