From d00df5b2383eb19a4906eca140286c80cfbaea94 Mon Sep 17 00:00:00 2001 From: maikia Date: Fri, 2 Sep 2022 14:40:08 +0200 Subject: [PATCH 1/2] fix docstring --- sklearn/metrics/_plot/det_curve.py | 20 ++++++++++---------- sklearn/tests/test_docstrings.py | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sklearn/metrics/_plot/det_curve.py b/sklearn/metrics/_plot/det_curve.py index 92e84ce9b7974..f49b4dbb6ec11 100644 --- a/sklearn/metrics/_plot/det_curve.py +++ b/sklearn/metrics/_plot/det_curve.py @@ -351,10 +351,10 @@ def plot(self, ax=None, *, name=None, **kwargs): @deprecated( - "Function plot_det_curve is deprecated in 1.0 and will be " - "removed in 1.2. Use one of the class methods: " - "DetCurveDisplay.from_predictions or " - "DetCurveDisplay.from_estimator." + "Function plot_det_curve is deprecated in 1.0 and will be " + "removed in 1.2. Use one of the class methods: " + "DetCurveDisplay.from_predictions or " + "DetCurveDisplay.from_estimator." ) def plot_det_curve( estimator, @@ -370,18 +370,18 @@ def plot_det_curve( ): """Plot detection error tradeoff (DET) curve. - Extra keyword arguments will be passed to matplotlib's `plot`. - - Read more in the :ref:`User Guide `. - - .. versionadded:: 0.24 - .. deprecated:: 1.0 `plot_det_curve` is deprecated in 1.0 and will be removed in 1.2. Use one of the following class methods: :func:`~sklearn.metrics.DetCurveDisplay.from_predictions` or :func:`~sklearn.metrics.DetCurveDisplay.from_estimator`. + Extra keyword arguments will be passed to matplotlib's `plot`. + + Read more in the :ref:`User Guide `. + + .. versionadded:: 0.24 + Parameters ---------- estimator : estimator instance diff --git a/sklearn/tests/test_docstrings.py b/sklearn/tests/test_docstrings.py index e1385f6953bdf..e8338def8a4c4 100644 --- a/sklearn/tests/test_docstrings.py +++ b/sklearn/tests/test_docstrings.py @@ -18,6 +18,8 @@ "sklearn.linear_model._omp.orthogonal_mp_gram", "sklearn.manifold._locally_linear.locally_linear_embedding", "sklearn.manifold._t_sne.trustworthiness", + # sklearn.deprecation._update_doc is updating the doc against the numpydoc. + # This will be fixed with issue: #24328 "sklearn.metrics._plot.det_curve.plot_det_curve", "sklearn.metrics._plot.precision_recall_curve.plot_precision_recall_curve", "sklearn.metrics._ranking.coverage_error", From cc1ca41f9ce87043cf346f5fd9247631ad6aa91e Mon Sep 17 00:00:00 2001 From: maikia Date: Fri, 2 Sep 2022 14:41:21 +0200 Subject: [PATCH 2/2] cleanup --- sklearn/metrics/_plot/det_curve.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sklearn/metrics/_plot/det_curve.py b/sklearn/metrics/_plot/det_curve.py index f49b4dbb6ec11..5b881a2b0239f 100644 --- a/sklearn/metrics/_plot/det_curve.py +++ b/sklearn/metrics/_plot/det_curve.py @@ -351,10 +351,10 @@ def plot(self, ax=None, *, name=None, **kwargs): @deprecated( - "Function plot_det_curve is deprecated in 1.0 and will be " - "removed in 1.2. Use one of the class methods: " - "DetCurveDisplay.from_predictions or " - "DetCurveDisplay.from_estimator." + "Function plot_det_curve is deprecated in 1.0 and will be " + "removed in 1.2. Use one of the class methods: " + "DetCurveDisplay.from_predictions or " + "DetCurveDisplay.from_estimator." ) def plot_det_curve( estimator,