Skip to content

DOC Add link to examples_manifold_plot_compare_methods.py to manifold.MDS docstring #29714

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

Merged
merged 6 commits into from
Aug 27, 2024

Conversation

davidcherney
Copy link
Contributor

@davidcherney davidcherney commented Aug 25, 2024

References issue #26927.

This PR aims to improve documentation by including a link to an example file that compares dimensionality reduction techniques to the doc string of the manifold.MDS class.

Other Comments

Consider the below proposal for

  1. a new use of the See Also section, and of
  2. a new convention for where in doc strings to place links to example files.

Observations

  1. There is not consensus by maintainers about where in the doc string developers should place links to an example files.

  2. The Developer's Guide says that example files might

    • demonstrate use
    • compare different algorithms
    • et cetera.
  3. The See Also section of doc strings is meant to be a list of FCMs (functions/classes/methods) for similar algorithms.

  4. Personally, I would appreciate finding link to detailed examples in the Examples section of doc strings just below the code snippet examples (in case the code snippets are not enough).

  5. Personally, I would appreciate finding a link to an example file that compares similar algorithms in the doc string just after the list of similar algorithms.

  6. Personally, I do not look for examples OR comparisons in the main section of a doc string; I look there for a simple statement of what the FCM does. (cf. @adrinjalali 's response to @ArturoAmorQ about prominent content.)

Opinion

I would make the following convention for this meta-issue #26927:

  1. If an example file gives a demonstration of an FMC with a level of detail beyond that available in the code snippets, then the link to the example file goes at the bottom of the Examples section of the doc string for the FMC with the wording "For a more detailed example, see ..."
  2. If an example file gives a comparison of related FMCs, then the link to the example file goes at the bottom of the Also See section of the doc string of the FMC with the wording "For a comparison of similar algorithms, see ...".

Trade-offs

  1. The See Also sections are, as of now, consistently and cleanly lists of related FCMs. My suggestion introduces a new use for the section, reducing consistency of use of the section.
  2. This (meta)-issue is inviting to first time contributors (like myself). Adding too many details will make it less inviting.
  3. In trying to put a link in the Also See section, I have found that some of the GitHub checks do not pass.

Copy link

github-actions bot commented Aug 25, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 75a6912. Link to the linter CI: here

@davidcherney davidcherney changed the title added See Also section to mds DOC string added link to examples_manifold_plot_compare_methods.py to manifold.MDS doc string Aug 25, 2024
Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your suggestions @davidcherney

Copy link
Member

@ArturoAmorQ ArturoAmorQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That blank space is creating a weird behavior in the render. But otherwise LGTM. Thanks @davidcherney :)

@ArturoAmorQ ArturoAmorQ enabled auto-merge (squash) August 27, 2024 15:55
@ArturoAmorQ ArturoAmorQ changed the title added link to examples_manifold_plot_compare_methods.py to manifold.MDS doc string DOC Add link to examples_manifold_plot_compare_methods.py to manifold.MDS docstring Aug 27, 2024
@ArturoAmorQ ArturoAmorQ merged commit 94d4a33 into scikit-learn:main Aug 27, 2024
30 checks passed
MarcBresson pushed a commit to MarcBresson/scikit-learn that referenced this pull request Sep 2, 2024
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Sep 9, 2024
glemaitre pushed a commit that referenced this pull request Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants