Skip to content
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

Duplicate docstrings between related classes and functions #242

Closed
vyasr opened this issue Nov 18, 2019 · 7 comments
Closed

Duplicate docstrings between related classes and functions #242

vyasr opened this issue Nov 18, 2019 · 7 comments
Labels
documentation Writing or editing documentation enhancement New feature or request pinned Instructs stale bot to ignore this issue.

Comments

@vyasr
Copy link
Contributor

vyasr commented Nov 18, 2019

Feature description

#235 follows a recurring theme where lack of duplication in the documentation leads to confusion because it's not always clear to users how the documentation of different classes/functions is linked or why. We should explore better ways to share docstrings without actually duplicating (which would increase maintenance costs and the chance of erroneous docstrings if we miss updating one of many places where something is copy-pasted).

Proposed solution

The most obvious solution is to perform runtime inspection and modification of docstrings by modifying the __doc__ attribute. In case such runtime modification runs into any issues with Sphinx documentation generation, we could instead use a more kludgy but perhaps less fragile solution like direct inclusion using reST's include directive.

Additional context

As long as we are not maintaining the same code/documentation in multiple places, I think duplication in the user-facing documentation is desirable. @atravitz has also indicated that such duplication would alleviate some of her confusion.

@vyasr vyasr added documentation Writing or editing documentation enhancement New feature or request labels Nov 18, 2019
@bdice
Copy link
Member

bdice commented Nov 18, 2019

  1. __doc__ modification works fine with Sphinx.
  2. Using the include directive would make docstrings useless on the command line. I use help() frequently and would prefer not to rely on rST directives.

@mikemhenry
Copy link
Collaborator

@atravitz you have been doing some excellent doc work lately, is this still an issue? I can't remember if made a decision on this.

@mikemhenry mikemhenry added this to the v2.0.0 milestone Feb 9, 2021
@mikemhenry
Copy link
Collaborator

We should also have this resolved by 2.x (if not sooner)

@stale
Copy link

stale bot commented Apr 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 18, 2021
@stale stale bot closed this as completed Jun 2, 2021
@vyasr vyasr added pinned Instructs stale bot to ignore this issue. and removed stale labels Feb 21, 2022
@vyasr
Copy link
Contributor Author

vyasr commented Feb 21, 2022

I think we still want to target this change for 2.0 if possible since docs are quite valuable for us. @atravitz do you know if there was more to be done here?

@vyasr vyasr reopened this Mar 19, 2022
@vyasr
Copy link
Contributor Author

vyasr commented Mar 19, 2022

@atravitz could you provide an update here?

@vyasr vyasr removed this from the v2.0.0 milestone Sep 18, 2022
@vyasr
Copy link
Contributor Author

vyasr commented Nov 2, 2022

I'm going to close this issue. Our docs have improved tremendously since it was first opened. There are probably still cases where we could benefit from more duplication of documentation, but we can address those on a more case-by-case basis when they arise.

@vyasr vyasr closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Writing or editing documentation enhancement New feature or request pinned Instructs stale bot to ignore this issue.
Projects
None yet
Development

No branches or pull requests

3 participants