Skip to content

Commit 05aa247

Browse files
authored
replace deprecationwarning with futurewarning (#5109)
* replace deprecationwarning with futurewarning * revert change
1 parent 2b92a05 commit 05aa247

18 files changed

+39
-39
lines changed

pymc/backends/tracetab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def trace_to_dataframe(trace, chains=None, varnames=None, include_transformed=Fa
4545
"The `trace_to_dataframe` function will soon be removed. "
4646
"Please use ArviZ to save traces. "
4747
"If you have good reasons for using the `trace_to_dataframe` function, file an issue and tell us about them. ",
48-
DeprecationWarning,
48+
FutureWarning,
4949
)
5050
var_shapes = trace._straces[0].var_shapes
5151

pymc/distributions/dist_math.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ def log_i0(x):
510510
def incomplete_beta(a, b, value):
511511
warnings.warn(
512512
"incomplete_beta has been deprecated. Use aesara.tensor.betainc instead.",
513-
DeprecationWarning,
513+
FutureWarning,
514514
stacklevel=2,
515515
)
516516
return at.betainc(a, b, value)

pymc/distributions/distribution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __new__(cls, name, bases, clsdict):
7878
def _random(*args, **kwargs):
7979
warnings.warn(
8080
"The old `Distribution.random` interface is deprecated.",
81-
DeprecationWarning,
81+
FutureWarning,
8282
stacklevel=2,
8383
)
8484
return clsdict["random"](*args, **kwargs)
@@ -204,7 +204,7 @@ def __new__(
204204
initval = kwargs.pop("testval")
205205
warnings.warn(
206206
"The `testval` argument is deprecated; use `initval`.",
207-
DeprecationWarning,
207+
FutureWarning,
208208
stacklevel=2,
209209
)
210210

@@ -296,7 +296,7 @@ def dist(
296296
"The `.dist(testval=...)` argument is deprecated and has no effect. "
297297
"Initial values for sampling/optimization can be specified with `initval` in a modelcontext. "
298298
"For using Aesara's test value features, you must assign the `.tag.test_value` yourself.",
299-
DeprecationWarning,
299+
FutureWarning,
300300
stacklevel=2,
301301
)
302302
if "initval" in kwargs:

pymc/distributions/multivariate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ def __init__(self, eta=None, n=None, p=None, transform="interval", *args, **kwar
14101410
"Parameters to LKJCorr have changed: shape parameter n -> eta "
14111411
"dimension parameter p -> n. Please update your code. "
14121412
"Automatically re-assigning parameters for backwards compatibility.",
1413-
DeprecationWarning,
1413+
FutureWarning,
14141414
)
14151415
self.n = p
14161416
self.eta = n
@@ -1435,7 +1435,7 @@ def __init__(self, eta=None, n=None, p=None, transform="interval", *args, **kwar
14351435
warnings.warn(
14361436
"Parameters in LKJCorr have been rename: shape parameter n -> eta "
14371437
"dimension parameter p -> n. Please double check your initialization.",
1438-
DeprecationWarning,
1438+
FutureWarning,
14391439
)
14401440
self.tri_index = np.zeros([n, n], dtype="int32")
14411441
self.tri_index[np.triu_indices(n, k=1)] = np.arange(shape)
@@ -1665,7 +1665,7 @@ def dist(
16651665
"The shape argument in MatrixNormal is deprecated and will be ignored."
16661666
"MatrixNormal automatically derives the shape"
16671667
"from row and column matrix dimensions.",
1668-
DeprecationWarning,
1668+
FutureWarning,
16691669
)
16701670

16711671
# Among-row matrices

pymc/gp/gp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ def marginal_likelihood(self, name, X, Xu, y, noise=None, is_observed=True, **kw
725725
self.sigma = sigma
726726
warnings.warn(
727727
"The 'sigma' argument has been deprecated. Use 'noise' instead.",
728-
DeprecationWarning,
728+
FutureWarning,
729729
)
730730
else:
731731
self.sigma = noise

pymc/math.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def invlogit(x, eps=None):
205205
if eps is not None:
206206
warnings.warn(
207207
"pymc.math.invlogit no longer supports the ``eps`` argument and it will be ignored.",
208-
DeprecationWarning,
208+
FutureWarning,
209209
stacklevel=2,
210210
)
211211
return at.sigmoid(x)

pymc/model.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ def datalogpt(self):
838838
def vars(self):
839839
warnings.warn(
840840
"Model.vars has been deprecated. Use Model.value_vars instead.",
841-
DeprecationWarning,
841+
FutureWarning,
842842
)
843843
return self.value_vars
844844

@@ -942,7 +942,7 @@ def test_point(self) -> Dict[str, np.ndarray]:
942942
"""Deprecated alias for `Model.recompute_initial_point(seed=None)`."""
943943
warnings.warn(
944944
"`Model.test_point` has been deprecated. Use `Model.recompute_initial_point(seed=None)`.",
945-
DeprecationWarning,
945+
FutureWarning,
946946
)
947947
return self.recompute_initial_point()
948948

@@ -951,7 +951,7 @@ def initial_point(self) -> Dict[str, np.ndarray]:
951951
"""Deprecated alias for `Model.recompute_initial_point(seed=None)`."""
952952
warnings.warn(
953953
"`Model.initial_point` has been deprecated. Use `Model.recompute_initial_point(seed=None)`.",
954-
DeprecationWarning,
954+
FutureWarning,
955955
)
956956
return self.recompute_initial_point()
957957

@@ -1548,7 +1548,7 @@ def update_start_vals(self, a: Dict[str, np.ndarray], b: Dict[str, np.ndarray]):
15481548
conditional on the values of `b` and stored in `b`.
15491549
15501550
"""
1551-
raise DeprecationWarning(
1551+
raise FutureWarning(
15521552
"The `Model.update_start_vals` method was removed."
15531553
" To change initial values you may set the items of `Model.initial_values` directly."
15541554
)
@@ -1630,7 +1630,7 @@ def check_start_vals(self, start):
16301630
def check_test_point(self, *args, **kwargs):
16311631
warnings.warn(
16321632
"`Model.check_test_point` has been deprecated. Use `Model.point_logps` instead.",
1633-
DeprecationWarning,
1633+
FutureWarning,
16341634
)
16351635
return self.point_logps(*args, **kwargs)
16361636

pymc/plots/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def alias_deprecation(func, alias: str):
3636

3737
@functools.wraps(func)
3838
def wrapped(*args, **kwargs):
39-
raise DeprecationWarning(
39+
raise FutureWarning(
4040
f"The function `{alias}` from PyMC was an alias for `{original}` from ArviZ. "
4141
"It was removed in PyMC 4.0. "
4242
f"Switch to `pymc.{original}` or `arviz.{original}`."

pymc/plots/posteriorplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def plot_posterior_predictive_glm(
5959
warnings.warn(
6060
"The `plot_posterior_predictive_glm` function will migrate to Arviz in a future release. "
6161
"\nKeep up to date with `ArviZ <https://arviz-devs.github.io/arviz/>`_ for future updates.",
62-
DeprecationWarning,
62+
FutureWarning,
6363
)
6464

6565
if lm is None:

pymc/sampling.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ def sample_posterior_predictive(
16501650
warnings.warn(
16511651
"In this version, RNG seeding is managed by the Model objects. "
16521652
"See the `rng_seeder` argument in Model's constructor.",
1653-
DeprecationWarning,
1653+
FutureWarning,
16541654
stacklevel=2,
16551655
)
16561656

@@ -1806,7 +1806,7 @@ def sample_posterior_predictive_w(
18061806
warnings.warn(
18071807
"In this version, RNG seeding is managed by the Model objects. "
18081808
"See the `rng_seeder` argument in Model's constructor.",
1809-
DeprecationWarning,
1809+
FutureWarning,
18101810
stacklevel=2,
18111811
)
18121812

@@ -1973,7 +1973,7 @@ def sample_prior_predictive(
19731973
warnings.warn(
19741974
"In this version, RNG seeding is managed by the Model objects. "
19751975
"See the `rng_seeder` argument in Model's constructor.",
1976-
DeprecationWarning,
1976+
FutureWarning,
19771977
stacklevel=2,
19781978
)
19791979

0 commit comments

Comments
 (0)