-
Notifications
You must be signed in to change notification settings - Fork 74
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
Compatibility with seaborn 0.13 #155
Conversation
compatibility with seaborn>=0.11 pass all tests
Tests don't pass only for python 3.6 which is EOL since 2021-12-23. Python 3.7 is also EOL, and python 3.8 is soon-to-be btw. Tests for python 3.12 are passing in local (only compatible with @trevismd you can review when you have time! Thanks |
It'd be great if this could be merged! |
I can confirm this works on my computer! Thank you so much. |
In the meantime, it would be great if people could test intensively. I only checked that tests were passing and that it was looking good for my usage. So it needs testing visually all the plot types (boxplot, violinplot, swarmplot, stripplot and barplot), with and without hue, horizontal and vertical. I also didn't check compatibility with the new Thanks! |
Hi @getzze I really like these changes and, in some cases, work well for me. I have found an issue with this code from stackoverflow
I get several warnings about group positions
and the image isn't quite right (see lines for p-values) |
@ryan-boobybiome I get these warnings also when using statannotations 0.6 main and sns.violinplot or sns.strippplot (Seaborn 0.12) with hue parameter set to a dataframe column. It doesn't seem to originate from getzze's branch. But I can confirm the positioning and formatting of the p-value lines is also incorrect for me in the code you posted. With some further testing, it seems that anything that involves the hue parameter comparing two paired groups has this effect. The positioning being incorrect only occurs if loc = 'inside'. However, the lack of a horizontal bar occurs either way (inside/outside).
|
Thanks for reporting, I'll check that. |
I fixed the problem with the position (it was a stupid missing |
@getzze many thanks - how do I update my installation from this branch to test? I did |
@ryan-boobybiome |
@getzze uninstall and reinstall worked well. Not sure what happened with upgrade! But I can confirm it all looks good now. Many thanks for the help |
the version is the same so upgrade won't reinstall unless forced or manually uninstalled/reinstalled. could maybe bump minor version to edit: version file is at |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #155 +/- ##
==========================================
- Coverage 97.11% 91.37% -5.74%
==========================================
Files 29 31 +2
Lines 1939 2493 +554
==========================================
+ Hits 1883 2278 +395
- Misses 56 215 +159 ☔ View full report in Codecov by Sentry. |
I tested with the script in #156 and corrected some bugs. |
What is currently blocking the merge? After some digging it seems that Seaborn 0.13 itself is not compatible with Python 3.6. |
A huge thank you for this contribution, @getzze . I'll soon merge this almost as is because I'm finding out I currently don't have the time to go in the nitty-gritty and the community really needs this. I'll officially remove support for 3.6 too for this new 0.7.0-alpha. |
Thanks @trevismd , let me know if I can help! |
If anyone needs to use this nice package and can't downgrade their seaborn, here is a temporary fix:
|
Hello @getzze , I started looking further into this and found a couple of issues when trying to run the usage notebook. One is the creation of The other is that (I'm not sure if it's related to the above temp fix or not) annotations positions do not seem correct in the case of example_barplot_hue.png (the others seem OK) where we get This is with python 3.12, seaborn 0.13.2, matplotlib 3.9.2. Other than that, I see we lose the use of a palette when not defining a Thank you very much again for the thorough work and your patience. |
I am checking it now and I also noticed that 'example_hue_layout.png' is completely wrong. Let me investigate... Env: python 3.12, seaborn 0.13.2, matplotlib 3.9.2.
Yes, it's a change in Seaborn, I will update the code to keep the same rendering. |
…g to change behavior
I implemented what you said (calling the argument
This was the same error as in 'example_hue_layout.png', I fixed it by storing I also added the |
fixes #81 #122 #131 #133 #143
Compatibility with seaborn>=0.11
All tests are passing
In
seaborn 0.12
, internals were rewritten for categorical plots and in version 0.13 again.There were also some changes to the interface:
native_scale
andformatter
(I added support for them only forseaborn
0.13)hue
can be used redundantly with ax
ory
variable to signal that the colors should change depending on this variable. Therefore I added code (and tests) to check for a redundanthue
parameter.I also removed the dependency blocker for
pandas<2.0.0
because it does not affectstatannotations
butseaborn
, therefore it should be dealt with inseaborn
. Test are passing withpandas==2.2.2
.Organization of this PR:
seaborn
version was put in acompat.py
file._GroupsPositions.py
and_Plotter.py
were reworked to be agnostic toseaborn
internals.