Uh oh!
There was an error while loading. Please reload this page.
Doc: Reorganize math module documentation - #126337
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Nodd
commented
Nov 2, 2024
Thanks @picnixz for the review, I included your modifications. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Nodd
commented
Nov 6, 2024
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? 😅 |
vstinner
commented
Nov 7, 2024
Overall, I like the new math doc organization. Nice work.
I'm not sure how special are these functions. Maybe just say "Other functions"? |
picnixz
commented
Nov 7, 2024
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. |
Nodd
commented
Nov 7, 2024
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. |
skirpichev
commented
Nov 8, 2024
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". |
Uh oh!
There was an error while loading. Please reload this page.
picnixz
left a comment
There was a problem hiding this comment.
LGTM (modulo Sergey's comment).
vstinner
commented
Nov 18, 2024
Merged, thank you. Should we backport the change to avoid merge conflicts? |
skirpichev
commented
Nov 18, 2024
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 |
vstinner
commented
Nov 18, 2024
@Nodd: Would you mind to try to backport this change to the 3.13 branch manually? There are merge conflicts. |
skirpichev
commented
Nov 18, 2024
3.12 backport also fails. Its all coming from #126215. |
Nodd
commented
Nov 18, 2024
Weird, I thought I already rebased the PR after the other modification. I'll look into it. |
vstinner
commented
Nov 18, 2024
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>
skirpichev
commented
Nov 19, 2024
I took liberty to do backport for 3.13. The 3.12 backport blocked by #126309. |
Nodd
commented
Nov 20, 2024
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
mathdocumentation. 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
frexpandmodfare in different sections. Note thatmodfis 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
sinandcosinstead ofacosandasin, orgcdandlcmcould be listed together. Same withsqrtandcbrt.Direct link to the updated
mathmodule documentation📚 Documentation preview 📚: https://cpython-previews--126337.org.readthedocs.build/