[Pandas-dev] Avoiding Dependencies on Private Modules

Marc Garcia garcia.marc at gmail.com
Fri Jul 19 07:27:54 EDT 2019


I don't think there is any better way. That's just an internal method, and
I don't think it makes sense to have it in the pandas public API.

May be you can check with Matplotlib if that function is something they
want to provide, that sounds like the best option to me if it's useful for
other projects.

If they are not interested, I'd personally just copy that file into your
project. Surely not an ideal solution, but of all the bad solutions I'd say
it's the best. There is no discussion about it yet, but we may want to move
`pandas.plotting._matplotlib` to a third-party package in the future. That
would break your code again if you just update the module path.

On Fri, Jul 19, 2019 at 12:10 PM Matthew Gidden <matthew.gidden at gmail.com>
wrote:

> Hi all,
>
> I am one of the developers of a niche scientific library, pyam [1]. We
> provide some standard plotting routines for users with our specific data
> model, many of which are shims for pandas plotting. In order to keep track
> of certain aspects of data-plot attributes, we utilize the
> `_get_standard_colors()` [2]. Before pandas 0.25.0, this lived in
> pandas.plotting._style. Now it lives in pandas.plotting._matplotlib.style.
> Of course, this change breaks our package - we know this is our fault for
> relying on a private module =).
>
> Therefore - I wanted to ask the list whether there is a better way to get
> this functionality that is provided in first-class public interfaces? For
> now we can hotfix the issue, but we would like to try to guarantee
> stability in the future.
>
> Cheers,
> Matt
>
> [1] https://pyam-iamc.readthedocs.io/en/latest/
> [2] https://github.com/IAMconsortium/pyam/blob/master/pyam/plotting.py#L37
> _______________________________________________
> Pandas-dev mailing list
> Pandas-dev at python.org
> https://mail.python.org/mailman/listinfo/pandas-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pandas-dev/attachments/20190719/d52f5a28/attachment-0001.html>


More information about the Pandas-dev mailing list