Skip to content

Commit 83e3545

Browse files
tomicaprettoricardoV94
authored andcommitted
Remove deprecated Constant alias
1 parent 4242faf commit 83e3545

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed

pymc/distributions/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
BetaBinomial,
5656
Binomial,
5757
Categorical,
58-
Constant,
5958
DiracDelta,
6059
DiscreteUniform,
6160
DiscreteWeibull,
@@ -139,7 +138,6 @@
139138
"Poisson",
140139
"NegativeBinomial",
141140
"DiracDelta",
142-
"Constant",
143141
"ZeroInflatedPoisson",
144142
"ZeroInflatedNegativeBinomial",
145143
"ZeroInflatedBinomial",

pymc/distributions/discrete.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"Poisson",
6262
"NegativeBinomial",
6363
"DiracDelta",
64-
"Constant",
6564
"ZeroInflatedPoisson",
6665
"ZeroInflatedBinomial",
6766
"ZeroInflatedNegativeBinomial",
@@ -1245,23 +1244,6 @@ def logcdf(value, c):
12451244
)
12461245

12471246

1248-
class Constant:
1249-
def __new__(cls, *args, **kwargs):
1250-
warnings.warn(
1251-
"pm.Constant has been deprecated. Use pm.DiracDelta instead.",
1252-
FutureWarning,
1253-
)
1254-
return DiracDelta(*args, **kwargs)
1255-
1256-
@classmethod
1257-
def dist(cls, *args, **kwargs):
1258-
warnings.warn(
1259-
"pm.Constant has been deprecated. Use pm.DiracDelta instead.",
1260-
FutureWarning,
1261-
)
1262-
return DiracDelta.dist(*args, **kwargs)
1263-
1264-
12651247
def _zero_inflated_mixture(*, name, nonzero_p, nonzero_dist, **kwargs):
12661248
"""Helper function to create a zero-inflated mixture
12671249

tests/distributions/test_discrete.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,13 +632,6 @@ def test_zero_inflated_dists_dtype_and_broadcast(dist, non_psi_args):
632632
assert x.eval().shape == (3,)
633633

634634

635-
def test_constantdist_deprecated():
636-
with pytest.warns(FutureWarning, match="DiracDelta"):
637-
with pm.Model() as m:
638-
x = pm.Constant("x", c=1)
639-
assert isinstance(x.owner.op, pm.distributions.discrete.DiracDeltaRV)
640-
641-
642635
class TestMoments:
643636
@pytest.mark.parametrize(
644637
"p, size, expected",

0 commit comments

Comments
 (0)