Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
changing user-facing DeprecationWarnings to FutureWarnings
  • Loading branch information
OriolAbril committed Jun 10, 2024
1 parent 1669d66 commit 7f25a2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions arviz/plots/ecdfplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`")
Expand All @@ -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

Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions arviz/tests/base_tests/test_plots_matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 7f25a2c

Please sign in to comment.