-
-
Notifications
You must be signed in to change notification settings - Fork 18.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
Define plot methods in class definitions #16913
Conversation
instead of pinning them to Series/DataFrame at the bottom of the files. (For reasons I dont quite get) Importing pandas.plotting._core at the top of core.series instead of near the bottom causes a circular-import problem. Avoided this by delaying import from core.series inside plotting._tools and plotting._core.
Am I understanding correctly that the point of |
Yes, that is correct. I think you will need to find a way to work around the circular dependency that you found without importing |
Great, thanks. Just changed those to check against ABCSeries and ABCDataFrame. Much prettier. |
@jbrockmendel : I was able to read more on the issue you referenced, and it occurs to me: why are you refactoring these methods? IIUC, the consensus was to just deprecate these methods. While refactoring may make things a little nicer from an organizational standpoint, IMO you should probably just leave it alone and deprecate immediately. Note: that would also allow you to not have to figure out why all of these tests are currently failing 😄 |
As a newcomer, I experienced a good deal of frustration in trying to figure out e.g. "where the heck is Also in many of these cases there is a good reason for the design decision, in which case it's a learning opportunity. (Thanks jreback!)
... [grumble] |
That is fair, but as these methods are being deprecated (correct me if I'm wrong), why aren't you using the preferred methods for invoking these functions? Using soon-to-be deprecated methods (you could be the one who deprecates it 😉 ) is generally not advised. If there are methods that you find frustrating to find, then by all means attempt to refactor those, but I'm still not convinced that you should be refactoring methods that are going to be deprecated. |
Also, I should add that many of these methods (like |
The thought (evidence to the contrary) was that a PR that doesn't change any logic wouldn't get the same pushback as something more ambitious.
…Sent from my iPhone
On Jul 13, 2017, at 6:33 PM, gfyoung ***@***.***> wrote:
As a newcomer, I experienced a good deal of frustration in trying to figure out e.g. "where the heck is Series.ptp defined??" I developed a strong preference for methods/attributes being defined in the first-place-you-look kind of way. In the case of the plot, hist, and boxplot, defining them inside the class DataFrame... block seems like the "one obvious way to do it".
That is fair, but as these methods are being deprecated (correct me if I'm wrong), why aren't you using the preferred methods for invoking these functions? Using soon-to-be deprecated (you could be the one who deprecates it 😉 ) methods is generally not advised.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
That's why I suggested you deprecate those two functions in your PR. You already have the backing of several maintainers judging from the issue, and I for one am in agreement with that decision. Thus, I would be happy to help you through the process of deprecation if that interests you. |
Tests broke because I didn't import
Notwithstanding the stuff I managed to break, avoiding the fragility of the circular-ish import between
OK. Does this just mean removing |
If so, then I'm going to push for this to be a separate PR. Removing those from the namespace then requires changes in |
Unfortunately, that does not appear to be the case. In fact, I think the current test failures are the same ones I saw on your initial commit. 😢
That is a fair point. That might go away once those
No. Deprecating means that we issue a BTW, if you want to see how the deprecation cycle works, have a look at #13777. The PR's to the right (on each bullet point) are the ones where the code got deprecated, and the PR's to the left are the ones where the code got removed. That being said, if you would like to contribute more, #6581 lists the current functions that have yet to be removed for this release (0.21). Those I guarantee will get no push-back! |
AFAICT the relevant error message in Travis is:
The last commit does import
I tried that just for kicks and it opens up a new can of worms. It necessitates edits in |
Slow down there 😄 ! Did you read my previous comment? I didn't say that you should remove them immediately. You should be deprecating only (see my comment above - I said we'll save removal for another time). DO NOT REMOVE. After deprecation, feel free to have a crack at removing that circular import (if possible). |
I did. In fact I quoted it to make clear what I was referencing.
The circular import is a Bad And Should Feel Bad. I'll be happy to come back later, get up to speed on the deprecation cycle conventions, and then make a PR for the thing that you care about. But since Travis doesn't want to play along, this will remain broken. Gotta go do bill-paying work. Closing. |
The reason I asked is because this comment doesn't make much sense given that deprecating just involves adding a |
Understood. Thanks for taking a crack at this. Feel free to address the deprecation when you have the time. |
This follows up on pandas-dev#16913 but cuts down on the scope of the PR.
instead of pinning them to Series/DataFrame at the bottom of the files.
(For reasons I dont quite get) Importing
pandas.plotting._core
at the top of core.seriesinstead of near the bottom causes a circular-import problem. Avoided this by delaying
import from core.series inside plotting._tools and plotting._core.
Follows-up on conversation in #11053