From 7f25a2c5e535ba1becf750c033f1c50cf3b5f6a2 Mon Sep 17 00:00:00 2001 From: Oriol Abril-Pla Date: Thu, 4 Apr 2024 18:06:32 +0200 Subject: [PATCH] Apply suggestions from code review changing user-facing DeprecationWarnings to FutureWarnings --- arviz/plots/ecdfplot.py | 8 ++++---- arviz/tests/base_tests/test_plots_matplotlib.py | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arviz/plots/ecdfplot.py b/arviz/plots/ecdfplot.py index 6de05f392e..033fa8959b 100644 --- a/arviz/plots/ecdfplot.py +++ b/arviz/plots/ecdfplot.py @@ -205,7 +205,7 @@ def plot_ecdf( if pointwise: warnings.warn( "`pointwise` has been deprecated. Use `confidence_bands='pointwise'` instead.", - DeprecationWarning, + FutureWarning, ) confidence_bands = "pointwise" else: @@ -217,7 +217,7 @@ def plot_ecdf( warnings.warn( "`fpr` has been deprecated. Use `ci_prob=1-fpr` or set `rcParam['stats.ci_prob']` to" "`1-fpr`.", - DeprecationWarning, + FutureWarning, ) if ci_prob is not None: raise ValueError("Cannot specify both `fpr` and `ci_prob`") @@ -237,7 +237,7 @@ def plot_ecdf( warnings.warn( "`values2` has been deprecated. Use `cdf=scipy.stats.ecdf(values2).cdf.evaluate` " "instead.", - DeprecationWarning, + FutureWarning, ) cdf = scipy_ecdf(np.ravel(values2)).cdf.evaluate @@ -255,7 +255,7 @@ def plot_ecdf( if pit: warnings.warn( "`pit` has been deprecated. Specify `values=cdf(values)` instead.", - DeprecationWarning, + FutureWarning, ) values = cdf(values) cdf = uniform(0, 1).cdf diff --git a/arviz/tests/base_tests/test_plots_matplotlib.py b/arviz/tests/base_tests/test_plots_matplotlib.py index 888da9fc5a..e5a97981ef 100644 --- a/arviz/tests/base_tests/test_plots_matplotlib.py +++ b/arviz/tests/base_tests/test_plots_matplotlib.py @@ -1348,31 +1348,31 @@ def test_plot_ecdf_deprecations(): dist = norm(0, 1) data = dist.rvs(1000) # base case, no deprecations - with does_not_warn(DeprecationWarning): + with does_not_warn(FutureWarning): axes = plot_ecdf(data, cdf=dist.cdf, confidence_bands=True) assert axes is not None # values2 is deprecated data2 = dist.rvs(200) - with pytest.deprecated_call(): + with pytest.warns(FutureWarning): axes = plot_ecdf(data, values2=data2, difference=True) # pit is deprecated - with pytest.deprecated_call(): + with pytest.warns(FutureWarning): axes = plot_ecdf(data, cdf=dist.cdf, pit=True) assert axes is not None # fpr is deprecated - with does_not_warn(DeprecationWarning): + with does_not_warn(FutureWarning): axes = plot_ecdf(data, cdf=dist.cdf, ci_prob=0.9) - with pytest.deprecated_call(): + with pytest.warns(FutureWarning): axes = plot_ecdf(data, cdf=dist.cdf, confidence_bands=True, fpr=0.1) assert axes is not None # pointwise is deprecated - with does_not_warn(DeprecationWarning): + with does_not_warn(FutureWarning): axes = plot_ecdf(data, cdf=dist.cdf, confidence_bands="pointwise") - with pytest.deprecated_call(): + with pytest.warns(FutureWarning): axes = plot_ecdf(data, cdf=dist.cdf, confidence_bands=True, pointwise=True)