mwaskom / seaborn

Statistical data visualization in Python
https://seaborn.pydata.org
BSD 3-Clause "New" or "Revised" License
12.59k stars 1.93k forks source link

fix: use PyCapsule Interface instead of Dataframe Interchange Protocol #3782

Open MarcoGorelli opened 1 week ago

MarcoGorelli commented 1 week ago

closes #3756 closes https://github.com/mwaskom/seaborn/issues/3533 I'm hoping that this can supersede https://github.com/mwaskom/seaborn/pull/3534

This means that you get support for quite a lot more, e.g.:

image

image

In addition, this has no effect on existing pandas users, as there's already an early return for pandas https://github.com/MarcoGorelli/seaborn/blob/0bd85071284d45f38cbf419b8cf1efb2179eda24/seaborn/_core/data.py#L284-L285


I'm sorry for having introduced the Interchange Protocol in the first place. It's turned out to be fairly problematic, see https://github.com/pandas-dev/pandas/issues/56732#issuecomment-2466301769 as the associated discussion for more context


cc @willayd for comments

WillAyd commented 1 week ago

Implementation wise I think this looks great. Nice work @MarcoGorelli