Skip to content

Consider using computed docstrings #2443

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

Open
kandersolar opened this issue Apr 23, 2025 · 1 comment
Open

Consider using computed docstrings #2443

kandersolar opened this issue Apr 23, 2025 · 1 comment

Comments

@kandersolar
Copy link
Member

As mentioned by @wholmgren in #2326 (comment), the new pvlib.iotools.psm4 functions have long, very similar docstrings, which may be improved by using computed docstrings:

If we go with the separate functions then I think we should venture into computed docstrings. Computed docstrings are now common in the pydata world but haven't yet been used in pvlib. The module is 800 lines and about half of those are minor permutations of a 100 line docstring - and this will only get worse if we mirror more of the NSRDB API.

Here are some breadcrumbs I found with a brief investigation:

Some additional food for thought: do the docstrings have to be generated at import time (may not work with some IDEs as linked above, plus adds import overhead), or can we find some way to generate them once during package build or installation?

@markcampanelli
Copy link
Contributor

Before adding complexity, I would ask “How often do these docstrings actually change?”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants