-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add entrypoint for plotting backends #3640
Conversation
EXCITING! |
if you merge from master you should get all green on the upstream-dev test now |
@andersy005 can you summarize what's needed on the holoviews and xarray side for this to work? |
A while back I opened this issue holoviz/hvplot#392. I am about to make modifications to hvplot/holoviews locally to test that this PR is going to work as expected. Once I have a better understanding of what's needed, I will report back. |
After looking at Pandas source code, it's my understanding that
This approach makes interfacing with Pandas objects easy as long as the plotting library adheres to this plotting API. Currently, Xarray's plotting API is closely tied to matplotlib. To support entrypoint for other plotting backend will likely require defining something similar to Pandas's plotting API. Is my interpretation correct? Pinging @TomAugspurger, @jsignell and @jbednar as they may have ideas on how to proceed with this implementation. |
Yep, that's the basic idea. Every call to |
@andersy005 Sorry I never followed up here. Trying to get out a new hvPlot release very soon. What's the current status here? @jsignell do you have any comments? |
To be clear, I'm just checking whether there's anything that I can or need to do in hvPlot so this can proceed smoothly. |
I put this PR on a back burner :). As I pointed out in #3640 (comment), it is my understand that xarray will need to define a minimal plotting API for this entrypoint feature to work properly. Would this plotting API be something xarray devs would be willing to have/support? Cc @shoyer @dcherian @jhamman I could be missing something here. So please let me know if there is another way of getting the entrypoint feature to work without needing to define a plotting API that third-party visualization libraries adheres to. |
Closing this because it has gone stale :( |
Do we not want to discuss this in the bi-weekly dev meetings perhaps? (Apologies if it has been and I just missed it.) This seems like a good idea to implement! |
👍🏽 I'm in favor of discussing this in the dev meetings... Being able to easily switch plotting backends would be a nice feature to have from a user's perspective. |
I'm sorry I missed pings on this. I am happy to join the dev meeting if that'd be helpful or I can just start paying better attention 🙄 |
There is a dev meeting this Wednesday (occurring every fortnight), would be great to see you there! |
Libraries, including
xarray
, register backends viaentrypoints
. Xarray adds an EntryPoint "group" in itssetup.py
. Third party libraries add items to that group in theirsetup.pys
.Xarray and the third-party library don't need to talk to each other directly to register a backend. They talk through
pkg_resources
.For instance,
hvplot/holoviews
would add an EntryPoint forxarray_plotting_backends
in its setup.py:and xarray users should be able to achieve what @jsignell proposed in #3553:
black . && mypy . && flake8
whats-new.rst
for all changes andapi.rst
for new API