-
Notifications
You must be signed in to change notification settings - Fork 674
Fix / Unit tests test_violin and test_pbmc3k
#1422
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
Fix / Unit tests test_violin and test_pbmc3k
#1422
Conversation
When using `seaborn==0.11`, the vertical orientation is ignored when only `x` is specified. To orientate the violin plot vertically, `seaborn.catplot` can be used instead of `seaborn.FacetGrid`. The keyword arguments `"cut"` and `"inner"` cannot be passed to `seaborn.catplot` or `seaborn.stripplot` and are thus moved to the `else` clause.
Following the changes in `_anndata.py`, the PNG file generated by `test_plotting.py:test_violin` has to be updated.
Following the changes in `_anndata.py`, the PNG file generated by `test_pbmc3k.py:test_pbmc3k` has to be updated.
|
@WeilerP Thanks for finding about this. Yes, please add explicitly |
Pass `x` as a keyword argument to `seaborn.violinplot` and `seaborn.stripplot`. This supresses seaborn's FutureWarning "From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation."
|
Thanks. Any idea why the images are now bigger (which I assume is the reason for the very small fonts)? |
Pass keyword arguments `scale`, `cut` and `inner` to `seaborn.catplot`.
|
Hm, no sorry, I don't. My best guess would be that |
|
I noticed, however, that the tests pass even when removing the |
|
The tests have a tolerance parameter that is set high. The problem is that the stripplot shows different results each time. Also, different versions of matplotlib and seaborn have slight differences. |
|
I wonder why the tests are not working now? |
Following the latest changes to `_anndata.py`, the expected PNG file generated by `test_pbmc3k.py:test_pbmc3k` is updated.
Sorry, I forgot to update |
Ah yes, I see. The stripplot result could be fixed by setting a seed with |
|
Hi Developers, I got the same issue when using seaborn==0.11, and fortunately I got the issue solved by replacing the annotate.py with the modified version. Howerver, I was wondering why I tried to use 'pip install scanpy' to update the scripts, it failed? Is there any other easier method to modify the script, not to locate the file and replace it? |
|
@hhhh1230511, this PR is not part of any release yet (the latest version Hope this helped and clarified things. |
Description
As briefly outlined in #1420, using
seaborn==0.11causes the unit testsscanpy/tests/test_plotting.py:test_violinandscanpy/tests/notebooks/test_pbmc3k.pyfail as the violin plots are no longer vertically oriented.Changes
seaborn.catplotandseaborn.stripplotinstead ofseaborn.FacetGridinscanpy/plotting/_anndata.pyRelated issues
Closes #1420.