-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Doc: Reorganize math module documentation #126337
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.
cc @skirpichev
Thanks @picnixz for the review, I included your modifications. |
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
ac07e54
to
a983ae1
Compare
Since this PR touches the whole file, merging and fixing the conflict was a pain... If this new layout is fine, can it be merged before another conflict arises? 😅 |
Overall, I like the new math doc organization. Nice work.
I'm not sure how special are these functions. Maybe just say "Other functions"? |
We had a brief discussion on this in #126337 (comment) (see also https://mathworld.wolfram.com/SpecialFunction.html). Now, not everyone knows about the "special functions" terminology which is first informal (there is no formal definition of what a "special function", it's just that we grouped some functions under the category of "Special functions") and second, it allows us to add whatever miscelleanous functions we want to add (although Sergey hinted that we probably won't add more than what the C standard does). So I think "Miscellaneous functions" or "Other functions" is also a good title. |
@vstinner Thank you for your kind words. About special functions, I proposed a change, see this comment thread. I learned that those are actually special. |
After thinking a bit more about it, one advantage of "Special function" is that it has a meaning to the specialists, and is no less informative than "Miscellaneous functions" or "Other functions" to other people. Those titles are too generic to actually mean anything. My initial proposal was to be explicit by using "Error and gamma functions". This title could be changed if another function is added in the future. In the end, I simply went with status quo wins. |
This is a best variant, IMO. It's aligned with the C standard. More generic title (like "Special functions") opens also the door for enhancement requests "lets add also this and that special functions". |
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.
LGTM (modulo Sergey's comment).
Merged, thank you. Should we backport the change to avoid merge conflicts? |
Yes, I think so. Because #125810 was backported. |
Sorry, @Nodd and @vstinner, I could not cleanly backport this to
|
Sorry, @Nodd and @vstinner, I could not cleanly backport this to
|
@Nodd: Would you mind to try to backport this change to the 3.13 branch manually? There are merge conflicts. |
3.12 backport also fails. Its all coming from #126215. |
Weird, I thought I already rebased the PR after the other modification. I'll look into it. |
The change is merged into the main branch. I'm asking about backporting the change to the 3.13 branch. Maybe some other doc changes were not backported to 3.13? |
(cherry picked from commit ce453e6) Co-authored-by: Joseph Martinot-Lagarde <contrebasse@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
GH-126998 is a backport of this pull request to the 3.13 branch. |
(cherry picked from commit ce453e6) Co-authored-by: Joseph Martinot-Lagarde <contrebasse@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
I took liberty to do backport for 3.13. The 3.12 backport blocked by #126309. |
Thank you @skirpichev for the backport. |
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Following #125810, here is a proposal to reorganize the
math
documentation. I took into account the comments from the previous PRs : #125810 (comment) #125810 (review) #125810 (comment) and tried to improve from here. As suggested in a comment, I used https://en.cppreference.com/w/c/numeric/math as reference.One thing I'm not fond of is the duplication of the paragraph about the return values, now that
frexp
andmodf
are in different sections. Note thatmodf
is also cited in another paragraph in Basic floating point operations.Another question I have is, should the functions be listed in alphabetic order, or in a logical order ? For example, the trigonometric functions could start with
sin
andcos
instead ofacos
andasin
, orgcd
andlcm
could be listed together. Same withsqrt
andcbrt
.Direct link to the updated
math
module documentation📚 Documentation preview 📚: https://cpython-previews--126337.org.readthedocs.build/