pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.57k stars 17.9k forks source link

VIS: register_matplotlib_converters is exposed through plotting backend #27152

Open jorisvandenbossche opened 5 years ago

jorisvandenbossche commented 5 years ago

With the recent plotting backend refactor, the pandas.plotting.register_matplotlib_converters is now referring to the "general" register which calls the plotting backend, instead of just being the matplotlib register function.

It probably doesn't make much sense to expose this through the plotting backend? It is maybe done for consistency (everything goes through the plotting backend, also internally), but personally I found this indirection confusing when looking at the source code (for this case).

cc @datapythonista

datapythonista commented 5 years ago

I agree, more than for consistency was done to be able to fully split the matplotlib code into a separate module (without doing too many tricky things).

I'm unsure whether registering converters is useful for any backend, and it may makes sense to simply change the name of the function. Or if users should call the function directly from the backend (the backend is currently private pandas.plotting._matplotlib, so this would probably require making it public).

This is being discussed in #26747

jorisvandenbossche commented 5 years ago

I personally don't think it makes sense for backends to have this (and if they have something similar, I don't think it should necessarily be exposed through pandas).

I wouldn't move the public API, the public name already has "matplotlib" in it, so it is rather clear it is for the matplotlib backend.