-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
API: pandas.api #13634
Comments
@jorisvandenbossche updated the top section. |
Related to second question in #13634 (whether to use FutureWarning or DeprecationWarning in deprecating the public pandas.core.common functions). As those functions are mostly used in library code, and less directly by users in their own code, I think a DeprecationWarning is more appropriate in this case. For example, in our own docs, we started to get warnings due to an example with a statsmodels regression that uses patsy using one of those functions. Note that recent IPython also shows DeprecationWarnings when using a deprecated function interactively. Author: Joris Van den Bossche <[email protected]> Closes #13990 from jorisvandenbossche/common-depr-warning and squashes the following commits: 2de5d48 [Joris Van den Bossche] Use DeprecationWarning for core.common deprecations (GH13634)
We have discussed this on some several places, recently also in the PR about the With the risk of keeping a settled discussion alive, I would still like to see this discussed some more. To repeat the comment of @shoyer:
We have recently added new submodules to the top-level namespace ( Let's take the example of |
Here's my rationale: We have 3 stakeholders.
For example. 'users': they are served by the top-level 'library': these folks need code generally for instrospection that is just too cumbersome to be in a 'user' namespace. Things like I recently added So, everything as public is just fine. If someone wants to reach in and use a routine from For simplicity from a user AND a library pov, its much better to have a single namespace |
I don't see a strong division between "users" and "advanced users". There is a continuum of use cases. Certainly we should group more things into submodules: this makes it easier to find related functionality. One choice that would make this super clear is move all internal stuff into a top level submodule called |
That is not fully what I meant. The
This is IMO not misleading at all, it is actually very explicit that it is internal.
This is already not fully the case. There are public methods in
Slightly of topic, but I personally would rather put this in |
ok so plan is to:
|
I started some search on github, but most of the things on the first pages were just internal imports in people who embedded the full pandas codebase in their repo ... Does anybody know of more advanced github search methods for such things? |
who the heck does that???? |
Regarding the above list, I am not sure we can easily move For |
Can you maybe first give some more details here, so we can discuss some things first before you do the work? (I also have some time this weekend to look at it) See my questions above (tseries). Further, |
quickly did #15997 (stil WIP), moving I think easy to move Further we will then have a big warning somewhere that |
I think we should also state that
|
But if we expose certain aspects of it in |
could move to io just as well. ok, i'll do that after @TomAugspurger merges then. any problem with the others that I mentioned? |
Then we first need a assessment on what exactly is public in tseries (as there certainly are public objects there) and how we expose this. |
what is the purpose of pandas.plotting? |
It holds the non-method plotting functions like |
so what is the argument for having that as a top level module then? |
plotting or types? Assuming you mean |
actually no, I mean I don't really see the purpose of the top-level further |
the more I look at this the more I don't think we need Why do we need this again? |
scatter_matrix, radviz, andrews_curves, parallel_coordinates, and autocorrelation_plot are all available in pandas.plotting and not on DataFrame. |
What do we envisage that will end up in there, apart from type related things? |
@jreback To come back to the
We now exposed the public hashing functions in |
both of those are not great |
Thoughts from anyone else? I think the proposals on the table are Option 1 (current master);
Option 2 (move types up):
Option 3 (maybe? Not sure if this is on the table, but for symmetry)
|
I like option 2. |
master is what it is |
@jreback Can you answer my comment above? #13634 (comment) (if you have an idea of course) I am ok with option 1 / master (pandas.api.types), if we have an idea of what else we would put in |
|
The objection I currently have against |
Another example is the Util is indeed a bunch of random things, but that is in its name, it is a bunch of various useful utility functions that don't really belong somewhere else. I think something like |
ok what i could do is make everything in until private but leave the top level namespace to export certain functions as a flat namespace |
yes, that would be a nice idea to expose certain things (like eg the cache_readonly) in the util submodule |
ok have a look for anything else |
xref pandas-dev#13634 CLN: move pandas.util.* validators, depr_module, decorators, print_versions to _ leading
xref pandas-dev#13634 CLN: move pandas.util.* validators, depr_module, decorators, print_versions to _ leading
xref pandas-dev#13634 CLN: move pandas.util.* validators, depr_module, decorators, print_versions to _ leading
* CLN: make submodules of pandas.util private xref #13634 CLN: move pandas.util.* validators, depr_module, decorators, print_versions to _ leading * CLN: move remaning extensions to _libs * pandas.tools.hashing FutureWarning -> DeprecationWarning
* CLN: make submodules of pandas.util private xref pandas-dev#13634 CLN: move pandas.util.* validators, depr_module, decorators, print_versions to _ leading * CLN: move remaning extensions to _libs * pandas.tools.hashing FutureWarning -> DeprecationWarning
* CLN: make submodules of pandas.util private xref pandas-dev#13634 CLN: move pandas.util.* validators, depr_module, decorators, print_versions to _ leading * CLN: move remaning extensions to _libs * pandas.tools.hashing FutureWarning -> DeprecationWarning
In xref #13147
established a bit of a public api in
pandas.api
; ATM this only contains the type introspection routines.1st question
Some disagreement on whether we should not do this, and rather just expose
pandas.types
directly.I think
pandas.api
is actually very important because:limits scope of what we choose to expose in the future; its not simply 'everything' that isnt nailed down (the case now). This does change pandas to make everything by default private, EXCEPT what is explicitly public.
a single entry point for other packages to use the pandas public API that is known / stable / maintained (will with c-API as well)
provide consistent naming externally (and allow us to fix / hide internally as needed)
namespaced. I only import what I need as a user / other package, rather than everything
2nd questionas discussed here, should these deprecated API functions should be
DeprecationWrarning
rather thanFutureWarning
?-> done in #13990
Ideally we should resolve this before the end of 0.19.0 (or remove it).
The text was updated successfully, but these errors were encountered: