-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Update Series min and max docstring. GH22459 #22554
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to have just a set of tests for min and max that illustrates both, to reduce te size of the code.
Also, can you explain better why implementing _make_min_max_function
was needed?
Thanks for the comments @datapythonista.
What tests do you mean? Or do you mean the examples? I wasn't sure how to do that, since the answer of an example is hard coded. Or is there a way to generate the answers when the docs are compiled? As in
Because I thought I couldn't use the other functions.
|
Ok, I understand. When I said having just a set of examples (that's what I meant by tests), I mean showing both methods in both docstrings. Instead of showing only examples for Then, if I'm not missing anything, we can simply set |
@datapythonista ok. I'll start working on it.
Yeah I think so. |
@datapythonista so you mean change
into
And same for If we do this, then it is not possible to add what the method does to the docstring summary. As in, now it says |
I took a closer look, and I understand what you did now. This code (the original) is a bit tricky. Let me take a closer look and see if we can make it simpler (I'd like to avoid creating the new function |
@datapythonista What about having a single general docstring for all methods, something like this:
This can than be used for all functions, also the ones which have a I took the liberty to rename some variables in the doc string such that it easier to see what is what. In order to use this new docstring I've updated
In the updated method I use the new variables and I've omitted the
where
and makes use of Shall I start implementing this for all methods which use |
- Changed `_make_min_max_function` such that in the future it can be used to replace `_bool_doc`, `_num_doc` and `_num_ddof_doc`.
Hello @Roald87! Thanks for updating the PR.
|
Codecov Report
@@ Coverage Diff @@
## master #22554 +/- ##
==========================================
+ Coverage 92.29% 92.31% +0.01%
==========================================
Files 161 161
Lines 51501 51473 -28
==========================================
- Hits 47534 47517 -17
+ Misses 3967 3956 -11
Continue to review full report at Codecov.
|
@datapythonista I made the following changes:
Also I pulled the latest changes from the original master branch, however this seems to have bricked pandas. I now get the following when I do
Is it generally a good idea to get the latest version while working on a PR or not? |
Sorry for the delay. Did you try to recompile the C parts of pandas I guess that should fix the error. As far as you start the PR with a fresh version of pandas, and there are no conflicts (like now), I don't think fetching the new changes adds a lot of value. It surely don't harm, and it's good to be updated, but in most cases won't make a difference. If you can try to recompile pandas, and also fetch from master to fix the conflict, we can move forward with this. |
I'd prefer to touch as less code as possible for these changes. I think with the current make_stats_func you can already provide the summary and examples as summary, and the rest is provided. What else is missing? If all the changes are for the see also section, let's leave this for another PR. Can you check how Sorry, but I think pandas code is complex enough, let's try to make the changes without adding anything else. |
Closing as stale. Also conflicts with some other development. Ping if you'd like to pick it back up |
@Roald87 would be great to get your work in this PR merged. Do you have time to merge master into your branch, and address the last comments? Please reopen the PR if that's the case. |
@datapythonista Yeah I'll try to do it this week. |
@WillAyd Could you open it again? @datapythonista I've made the changes. I see the a Also can't generate the html docs anymore. I get the following:
|
|
I think reusing the examples for |
@datapythonista OK done. It was |
If I understood it correctly, we're finally not merging this, as it's superseded by #23338. Feel free to reopen if I misunderstood. |
git diff upstream/master -u -- "*.py" | flake8 --diff
Doesn't pass all the tests, but can figure out where they come from.
Also I find the way the axis are defined quite confusing. My initial thought was that if you say
axis='index'
it would take apply your function on a row wise basis.