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: drastic rewrite of constants documentation #11682
DOC: drastic rewrite of constants documentation #11682
Conversation
If this rewrite is too drastic, let me know.
@jakobjakobson13 Thanks a lot for doing this. Is it possible that you work on this file offline such that it doesn't choke the CI/CD pipeline? Because you are placing a commit each time you make a change it is firing up a new trigger for all the tools as you can see below. |
I did not manage to compile the documentation at my laptop but I'll try it for the next commits. For the moment I would wait anyway for any comments of you guys before I push/make any further commits. |
scipy/constants/__init__.py
Outdated
|
||
Force | ||
----- | ||
or via the dictionaries stored in :mod:`scipy.constants.physical_constants` |
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 is the cause of the doc build warnings, there is no module physical_constants
. Shouldn't this just be scipy.constants
?
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.
Ah no, you are wanting to refer to physical_constants
, which is simply a dictionary not a module (so both the :mod:
is wrong and the sentence may need a tweak:
In [3]: type(constants.physical_constants)
Out[3]: dict
You can see the rendered version in the I like the restructure, first a sensible explanation and the huge list at the end makes sense. |
scipy/constants/__init__.py
Outdated
================== | ||
In 2019 seven système international d’unités (SI) base units were (re)defined to | ||
serve as a basis for all physical quantities by the bureau | ||
international des poids et mesures (BIPM) [SIunits]_. They can be summarized as followed |
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.
the [ ]
brackets need removing.
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.
Well, here I wanted to provide the link with background information. Should I delete it anyway or change its label into "Introduction" or something similar?
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.
No the link is fine, it's just the brackets that are now part of the link and look weird, also SIunits
isn't the most informative name. How about simply:
(see [1])
scipy/constants/__init__.py
Outdated
``u`` atomic mass constant (in kg) | ||
``atomic_mass`` atomic mass constant (in kg) | ||
================= ============================================================ | ||
- The ampere :math:`\mathrm{A}` as the SI unit of electric current is derived |
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 would read better as ampere (A)
rather than ampere A
. And same for next lines.
Okay, so CircleCI fails due to So, how should this be handled? |
The For the refguide check, one possible fix is to add all those objects to the skiplist at https://github.com/scipy/scipy/blob/master/tools/refguide_check.py#L127 (in an efficient way, using a list comprehension and a string join, rather than repeating The argument for the skiplist fix would be that constants don't need separate pages - they don't have docstrings. However, that runs the risk of the list being/becoming incomplete. So probably the more robust fix is to make sure the long listing you have is of the right form (typeset as links rather than code). I'll comment on the diff for the fix. EDIT: never mind, there's already a special-casing of those constants, the issue was the listing in this PR is incomplete (e.g. |
|
||
=========================== ================================================================= | ||
``c`` speed of light in vacuum |
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.
Actually, this you removed and didn't put back. Same for the other ones - that explains the CI failure
@jakobjakobson13 Friendly nudge about online changes. You can still push your changes all at once at one go via git commits. Then you don't need to save things and trigger CI/CD pipelines with which we don't want to be throttled. If you need help with offline builds please ask for help. |
Okay, got it. |
Before you push this comment to the master branch, I have the following comments:
|
|
||
About the SI units |
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 is reference documentation, so background material would better go to the bottom of the page, as people are mainly going to be looking for variable/function names etc. (except maybe the first time when reading this).
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.
Okay, I'll do it later.
scipy/constants/constants.py
Outdated
# functions for conversions that are not linear | ||
|
||
from .codata import value | ||
import numpy as np |
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 is no-go, the constants in this file can't be just removed without breaking backward compat.
I'd recommend to stick with documentation changes in this PR, other unrelated changes should go to separate PRs.
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 is no-go, the constants in this file can't be just removed without breaking backward compat.
Okay, I'll revert it later.
I'd recommend to stick with documentation changes in this PR, other unrelated changes should go to separate PRs.
Should I go for it anyway as it breaks backwards compatibility?
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.
Should I go for it anyway as it breaks backwards compatibility?
I think not, as we can't remove them (and deprecation etc. does not seem warranted, and hard to do for constants). But as a general comment, it's better to stick to one topic in one PR.
As I deleted my scipy repository and the specific branch, I'm closing this pull request. |
@jakobjakobson13 do you still plan to work on this? |
That´s up to you. However, if I work on it, I´ll slim it down drastically with the main page consisting of the following information:
And a subpage giving the following background:
[1] The International System of Units – 9th edition – Complete text in English and French (2019) |
Also, I deleted my fork on my hard drive and on Github. Does this mean, I would have to restart from scratch? |
You seems to be the reference for this module so I would trust your judgment.
No 😃 The changes are still available here and you can use for instance GitHub's CLI to pull it with |
After second thoughts, I would defer this pull request to some time later. Feel free to take over. |
If this rewrite is too drastic, let me know.
Reference issue
Fixes #11173
What does this implement/fix?
It is an overhaul of the constants documentation.
Related pull requests
#11343 and #11345 are also concerning the constants module however with a different focus.