-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
Doc: Add a single table as summary to math documentation #125810
Conversation
Thanks for doing this, and linking directly to the preview. I think the summary would be a little better if the arguments were shown, especially since sometimes a value mentioned in the summary is an argument, and sometimes a constant:
|
I thought about that too, and I even started to implement it. It looks indeed better, but it has to be done manually, so it's a bit tedious. If someone knows a better way than this: :func:`pow(x, y) <pow>` I'm all ears! |
The parens are added by a sphinx setting (wrongly, I always thought, as |
I added the arguments. I choose to not mark default, positional-only nor keyword-only arguments in the table to keep it as light as possible. |
👍 I like single table much more. FYI, There is an open PR for string methods: #1709 |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@@ -26,6 +26,92 @@ The following functions are provided by this module. Except when explicitly | |||
noted otherwise, all return values are floats. | |||
|
|||
|
|||
==================================================== ============================================ | |||
**Number-theoretic and representation 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.
I think this should be split out.
For some inspiration you could take look on the C17 and sections in the Annex F.10, e.g. here: https://en.cppreference.com/w/c/numeric/math. So, we should have something like 1) "Floating-point manipulation functions", 2) "Classification and comparison", 3) "Nearest integer operations", 4) "Basic operations" (maybe prod/fsum/etc - should be here).
Number-theoretic/combinatorial functions deserve a separate section.
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.
Thank you for your suggestion. I simply used the current organization of the page, and copied the existing section labels in the page. I think that reorganizing the whole page can be made in another PR, to focus this one on adding the table. I can do it afterwards.
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.
This looks like a nice improvement to the docs as written. My recommendation would be to merge. If necessary, we can iterate on future PRs.
Thanks @Nodd for your first contribution 🎉
As an FYI, you can ask for folks to rereview here instead of discuss.python.org.
Thanks @willingc, I wasn't sure where was the best to ask for review. I'll keep it in mind for next time. |
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 saw that you were just re-using the same titles as the sections as well as their order so I think it's ok for this PR. However, in a follow-up PR we should address the following:
- "Angular conversion" should be put before trigonometric functions so that trigonometric and hyperbolic ones are next to each other.
- We should say "Power, exponential and logarithmic functions" and not just "Power and logarithmic functions" because
exp(x)
is not a power function per se.
@picnixz, see also #125810 (comment) |
Folks, I'm merging this as is. Future PRs can iterate on sections and wording. Thanks! |
…5810) * Summary for math module with separate tables * Forgot remainder description * Single table * data instead of func * Add arguments in the table * Fix inconsistencies in pow documentation * Remove full stops from the table Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> * Fix math.pow link * Fix spacing --------- (cherry picked from commit 74cf596) Co-authored-by: Joseph Martinot-Lagarde <contrebasse@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…5810) * Summary for math module with separate tables * Forgot remainder description * Single table * data instead of func * Add arguments in the table * Fix inconsistencies in pow documentation * Remove full stops from the table Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> * Fix math.pow link * Fix spacing --------- (cherry picked from commit 74cf596) Co-authored-by: Joseph Martinot-Lagarde <contrebasse@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
GH-126308 is a backport of this pull request to the 3.13 branch. |
GH-126309 is a backport of this pull request to the 3.12 branch. |
…25810) (GH-126308) Doc: Add a single table as summary to math documentation (GH-125810) * Summary for math module with separate tables * Forgot remainder description * Single table * data instead of func * Add arguments in the table * Fix inconsistencies in pow documentation * Remove full stops from the table * Fix math.pow link * Fix spacing --------- (cherry picked from commit 74cf596) Co-authored-by: Joseph Martinot-Lagarde <contrebasse@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This is an draft for a table summary for the math module, as discussed in discourse. This is the version with a single table, with intermediate headers.
Direct link to the page preview
There is an alternative with multiple tables
📚 Documentation preview 📚: https://cpython-previews--125810.org.readthedocs.build/