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

get_df fails with default arguments #649

Closed
WeilerP opened this issue Aug 19, 2021 · 0 comments · Fixed by #1231
Closed

get_df fails with default arguments #649

WeilerP opened this issue Aug 19, 2021 · 0 comments · Fixed by #1231
Labels
bug Something isn't working

Comments

@WeilerP
Copy link
Member

WeilerP commented Aug 19, 2021

Description

Running scvelo.core.get_df (scv.read_load.get_df on scvelo@master) fails when using it default arguments.

import scvelo as scv

adata = scv.datasets.pancreas()
scv.core.get_df(adata)
Error
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-1cfc8708fcb5> in <module>
----> 1 scv.core.get_df(adata)

~/code/scvelo/scvelo/core/_anndata.py in get_df(data, keys, layer, index, columns, sort_values, dropna, precision)
    223 
    224         keys = [keys] if isinstance(keys, str) else keys
--> 225         key = keys[0]
    226 
    227         s_keys = ["obs", "var", "obsm", "varm", "uns", "layers"]

TypeError: 'NoneType' object is not subscriptable

Versions:

scvelo@dev
scvelo==0.2.3 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 Aug 19, 2021
@WeilerP WeilerP assigned WeilerP and unassigned WeilerP Aug 24, 2021
Oisin-M added a commit to Oisin-M/scvelo that referenced this issue Feb 28, 2024
Oisin-M added a commit to Oisin-M/scvelo that referenced this issue Feb 28, 2024
Oisin-M added a commit to Oisin-M/scvelo that referenced this issue Feb 28, 2024
WeilerP added a commit that referenced this issue Apr 12, 2024
* Fix `get_df` for default parameters (#649)

* If  is a string, put it into a list

* Add deprecation warning to `get_df`

---------

Co-authored-by: Philipp Weiler <weiler.philipp@gmail.com>
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

Successfully merging a pull request may close this issue.

1 participant