Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC improve docstring in OPTICS functions compute_optics_graph #22024

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

Conversation

moonkyung-kang
Copy link
Contributor

Reference Issues/PRs

#21350

What does this implement/fix? Explain your changes.

End the sentence with a period.

Any other comments?

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM. The error that you get will be fixed once #22028 is merged.

@@ -68,7 +68,7 @@ class OPTICS(ClusterMixin, BaseEstimator):
should take two arrays as input and return one value indicating the
distance between them. This works for Scipy's metrics, but is less
efficient than passing the metric name as a string. If metric is
"precomputed", X is assumed to be a distance matrix and must be square.
"precomputed", 'X' is assumed to be a distance matrix and must be square.
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to use the following.

Suggested change
"precomputed", 'X' is assumed to be a distance matrix and must be square.
"precomputed", `X` is assumed to be a distance matrix and must be square.

@@ -405,9 +405,9 @@ def compute_optics_graph(
Parameters
----------
X : ndarray of shape (n_samples, n_features), or \
(n_samples, n_samples) if metric=’precomputed’.
(n_samples, n_samples) if metric=’precomputed’
Copy link
Member

Choose a reason for hiding this comment

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

These quotes are weird.

Suggested change
(n_samples, n_samples) if metric=precomputed
(n_samples, n_samples) if metric="precomputed"

Copy link
Member

Choose a reason for hiding this comment

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

What do you think if we use instead:
(n_samples, n_samples) if metric='precomputed'

I think it is more consistent with the rest of the code.

Copy link
Member

Choose a reason for hiding this comment

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

Good point

@glemaitre
Copy link
Member

So this is not a big deal for this PR. But be aware that you did not created a branch from main when creating this branch. Thus you have changes from the PR #22024.

I closed #22024 and we will merge both changes.

If you want to do new PR in the future, please checkout (also git switch works now) to main. Then, pull the last changes from the scikit-learn repository and create a new branch.

@glemaitre glemaitre self-assigned this Jan 24, 2022
@glemaitre glemaitre changed the title DOC Ensures that sklearn.cluster. optics.compute optics graph numpydoc validation DOC improve docstring in OPTICS functions Jan 24, 2022
@glemaitre
Copy link
Member

I see that another PR was merged that fixed most of the issues. There is still a couple of nitpicking improvements that I will merge even if they are not required to pass the NumPy doc test.

@glemaitre glemaitre merged commit ac6273e into scikit-learn:main Jan 24, 2022
@glemaitre
Copy link
Member

Thanks @Moonkyung94

@thomasjpfan thomasjpfan changed the title DOC improve docstring in OPTICS functions DOC improve docstring in OPTICS functions compute_optics_graph Mar 19, 2022
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