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

Skip to content

DOC Ensures that plot_roc_curve passes numpydoc validation #21547

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 16 commits into from
Nov 29, 2021
Merged

DOC Ensures that plot_roc_curve passes numpydoc validation #21547

merged 16 commits into from
Nov 29, 2021

Conversation

MrinalTyagi
Copy link
Contributor

@MrinalTyagi MrinalTyagi commented Nov 4, 2021

Reference Issues/PRs

Addresses #21350
This PR ensures plot_roc_curve is compatible with numpydoc:

What does this implement/fix? Explain your changes.

  1. Remove sklearn.metrics._plot.roc_curve.plot_roc_curve from DOCSTRING_IGNORE_LIST.
  2. Verify that all tests are passing.

Any other comments?

Addresses #21350
This PR ensures precision_score is compatible with numpydoc:

1. Remove sklearn.metrics._plot.roc_curve.plot_roc_curve from DOCSTRING_IGNORE_LIST.
2. Verify that all tests are passing.
@MrinalTyagi
Copy link
Contributor Author

MrinalTyagi commented Nov 4, 2021

@thomasjpfan @glemaitre Can u help me fix the conflicts?

@MrinalTyagi MrinalTyagi changed the title DOC Ensures that precision_score passes numpydoc validation DOC Ensures that plot_roc_curve passes numpydoc validation Nov 4, 2021
`plot_roc_curve` is deprecated in 1.0 and will be removed in
1.2. Use one of the following class methods:
:func:`~sklearn.metrics.RocCurveDisplay.from_predictions` or
:func:`~sklearn.metrics.RocCurveDisplay.from_estimator`.

Copy link
Member

Choose a reason for hiding this comment

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

you need to move these lines as it was previously (see the diff).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

did as you directed but tests still failing

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.

You will also need to merge the main branch into your branch when #21549 will be merged. The last release of setuptools broke our CIs and they will be working once the PR is merged.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

This separating blank line is still needed but you should not add trailing whitespace:

@MrinalTyagi
Copy link
Contributor Author

If i move the deprecation warning to the original position, tests fail on my local machine. @glemaitre

@ogrisel
Copy link
Member

ogrisel commented Nov 5, 2021

If i move the deprecation warning to the original position, tests fail on my local machine. @glemaitre

Can you please share the error message or push the change so that we all see the error on the CI. I agree with @glemaitre that we want the deprecated directive after the main elements of the docstring.

@cmarmo
Copy link
Contributor

cmarmo commented Nov 5, 2021

Hi @MrinalTyagi

Can you please share the error message or push the change so that we all see the error on the CI. I agree with @glemaitre that we want the deprecated directive after the main elements of the docstring.

If you can find some time to fix the lint error

sklearn/metrics/_plot/roc_curve.py:421:1: W293 blank line contains whitespace

then tests will be run on the CI and it will be easier to find what is going wrong. Thanks!

@MrinalTyagi
Copy link
Contributor Author

Hi @MrinalTyagi

Can you please share the error message or push the change so that we all see the error on the CI. I agree with @glemaitre that we want the deprecated directive after the main elements of the docstring.

If you can find some time to fix the lint error

sklearn/metrics/_plot/roc_curve.py:421:1: W293 blank line contains whitespace

then tests will be run on the CI and it will be easier to find what is going wrong. Thanks!

thank you for the help. :)

@MrinalTyagi
Copy link
Contributor Author

Can someone merge this pr?

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Can someone merge this pr?

No since you have not addressed this comment #21547 (comment) which is a rephrasing of the first comment of @glemaitre: #21547 (comment) (if I understand correctly).

Please move the deprecation directive lower in the docstring to keep the most important information first. If you get an error message you do not understand when you run the tests locally, please paste it here as a comment so that we can try to help you or just push the change to the PR so that we have an opportunity to read the message in the CI report.

@ogrisel
Copy link
Member

ogrisel commented Nov 6, 2021

Ok I understand the problem: the @deprecated decorator is already changing the content of the docstring and the numpydoc validation is working on this.

Since we already have the deprecation information in the altered docstring information from the @deprecated decorator, there is no need in putting it again in the docstring.

We could probably improve the @deprecated to improve the formatting and make it insert a .. deprecated directive after the top level oneliner but this is out of the scope of this PR.

For now, let's just remove the redundant ..deprecated directive

@MrinalTyagi
Copy link
Contributor Author

Can someone merge this pr?

No since you have not addressed this comment #21547 (comment) which is a rephrasing of the first comment of @glemaitre: #21547 (comment) (if I understand correctly).

Please move the deprecation directive lower in the docstring to keep the most important information first. If you get an error message you do not understand when you run the tests locally, please paste it here as a comment so that we can try to help you or just push the change to the PR so that we have an opportunity to read the message in the CI report.

really sorry for not responding to the same as I thought all tests were clear so its all working fine.

@MrinalTyagi
Copy link
Contributor Author

MrinalTyagi commented Nov 6, 2021

Ok I understand the problem: the @deprecated decorator is already changing the content of the docstring and the numpydoc validation is working on this.

Since we already have the deprecation information in the altered docstring information from the @deprecated decorator, there is no need in putting it again in the docstring.

We could probably improve the @deprecated to improve the formatting and make it insert a .. deprecated directive after the top level oneliner but this is out of the scope of this PR.

For now, let's just remove the redundant ..deprecated directive

By this you mean to completely remove this section of text, right?

.. deprecated:: 1.0
or the complete deprecation warning?
.. deprecated:: 1.0
plot_roc_curve is deprecated in 1.0 and will be removed in
1.2. Use one of the following class methods:
:func:~sklearn.metrics.RocCurveDisplay.from_predictions or
:func:~sklearn.metrics.RocCurveDisplay.from_estimator.

@MrinalTyagi MrinalTyagi requested a review from ogrisel November 6, 2021 16:26
@MrinalTyagi MrinalTyagi requested a review from glemaitre November 8, 2021 11:28
@MrinalTyagi
Copy link
Contributor Author

@glemaitre can u update me if any changes is required as I by mistakenly pushed another issue work in this pr. Sorry for the inconvenience as I am new to this.

@MrinalTyagi
Copy link
Contributor Author

@glemaitre @ogrisel any update on the pr? Let me know if I need to perform any modifications.

@MrinalTyagi
Copy link
Contributor Author

@glemaitre @ogrisel Please tell me how to proceed with the following pr as I have already implemented all the changes requested

@MrinalTyagi
Copy link
Contributor Author

@ogrisel Please tell me how to proceed.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

@MrinalTyagi +1 for completely removing the redundant section in the docstring and only keep the decorator.

Then LGTM (assuming CI is green).

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.

The documentation looks much nicer.
LGTM. I will merge once all CI will be green.
Thanks @MrinalTyagi

@MrinalTyagi
Copy link
Contributor Author

Thanks :)

@ogrisel ogrisel merged commit 863bbc0 into scikit-learn:main Nov 29, 2021
@ogrisel
Copy link
Member

ogrisel commented Nov 29, 2021

Merged. Thanks again @MrinalTyagi and sorry for the slow reply.

samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Dec 24, 2021
glemaitre pushed a commit that referenced this pull request Dec 25, 2021
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.

4 participants