-
Notifications
You must be signed in to change notification settings - Fork 991
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
Docstring parameter descriptions are somewhat redundant and inconsistent #1421
Comments
A compromise is short description (for REPL) + “for more detail description see :glossary: |
I have a number of times noticed the issue of inconsistent naming of the same variable in different places. So I'm definitely in favor of implementing sphinx glossary. However, I also share @mikofski's point that it would be nice to have a combination. Perhaps for simple stuff like However, for less intuitive variables, such as acronyms, I would prefer a small description. For example, many users might not know what
Then, the range, convention, and a more elaborate description can be provided in the glossary. |
Is anyone currently working on this? If not, I am very interested in taking on this work. I have a few projects running currently though so I might be a bit slow, but I guess since this is unresolved since 2022 we'd be okay with a few months more? 😅 |
Can we convert the "Variables and Symbols" page to a glossary as a first step? I am hesitant to remove the descriptions from docstrings. For those browsing the code, using the command line to look at documentation, or reviewing changes, having AOI spelled out along with "see :term: |
Sounds reasonable to me 👍🏾 |
Is your feature request related to a problem? Please describe.
Conventions like pvlib's definition of
surface_tilt
andsurface_azimuth
are documented somewhat haphazardly in docstring parameter descriptions. This is objectionable in that it is redundant (same description appears in many places) and inconsistent (not all descriptions are the same for a particular parameter). For example many functions inpvlib.irradiance
have parameter descriptions like this:pvlib-python/pvlib/irradiance.py
Lines 553 to 555 in df1c56e
while some others have this:
pvlib-python/pvlib/irradiance.py
Line 329 in df1c56e
Describe the solution you'd like
I'm proposing we convert the "Variables and Symbols" page into a sphinx glossary. Much like how
:py:func:
links to function definitions, sphinx glossaries allow you to link terms to their definitions using:term:`surface_tilt`
. So a glossary like this:would let all
surface_tilt
docstring parameter descriptions reduce to something like this:Describe alternatives you've considered
The downside I see to extracting and centralizing this information is that the gallery definitions are only immediately accessible in the built sphinx docs, so
help(pvlib.irradiance.klucher)
andpvlib.irradiance.klucher?
will be less useful (or, depending on your viewpoint, less cluttered). So there is an argument to be made that centralizing this information is not a net gain and we should continue including it in the docstrings themselves.Additional context
#1253 is vaguely relevant
The text was updated successfully, but these errors were encountered: