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

Missing .raw attribute should raise proper exception #49

Closed
gokceneraslan opened this issue Aug 21, 2018 · 6 comments
Closed

Missing .raw attribute should raise proper exception #49

gokceneraslan opened this issue Aug 21, 2018 · 6 comments
Labels

Comments

@gokceneraslan
Copy link
Contributor

Hey,

adata = sc.datasets.paul15()
adata._get_obs_array('Sfpi1', use_raw=True)

raises ValueError: Did not find Sfpi1 in obs.keys or var_names. However the correct exception should be ".raw doesn't exist" or so.

How I ended up with this was actually sc.pl.scatter(adata, 'Sfpi1', 'Gata1'), which raises the same exception. Raising an exception explicitly about the lack of .raw would be much more informative for users.

I guess @Koncopd added the layer support, so he might be interested.

@Koncopd
Copy link
Member

Koncopd commented Aug 21, 2018

Added this 4148828

I also believe that it should be use_raw=False (not it is True) as the default option in scatter...

@falexwolf
Copy link
Member

The default option in sc.pl.scatter should be use_raw=None which defaults to looking up .raw if it exists and not looking it up otherwise. This is indeed the current behaviour even though the default is use_raw=True. I can easily change this, I think, without breaking anything. So I'll go ahead and do it.

@falexwolf
Copy link
Member

This would be the corresponding commit: scverse/scanpy@9a7c0a9

@gokceneraslan
Copy link
Contributor Author

Cool! That makes a lot of sense...

falexwolf referenced this issue in scverse/scanpy Aug 22, 2018
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity.
Please add a comment if you want to keep the issue open. Thank you for your contributions!

@github-actions github-actions bot added the stale label Jul 24, 2023
@flying-sheep
Copy link
Member

this is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants