Skip to content

Commit 8b90bed

Browse files
authored
Merge pull request #325 from pymc-labs/futurewarning
Fix `FutureError` warning, which requires `pymc>=5.14.0`
2 parents c7b8c26 + cbe942b commit 8b90bed

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

causalpy/pymc_models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class ModelBuilder(pm.Model):
4141
>>> class MyToyModel(ModelBuilder):
4242
... def build_model(self, X, y, coords):
4343
... with self:
44-
... X_ = pm.MutableData(name="X", value=X)
45-
... y_ = pm.MutableData(name="y", value=y)
44+
... X_ = pm.Data(name="X", value=X)
45+
... y_ = pm.Data(name="y", value=y)
4646
... beta = pm.Normal("beta", mu=0, sigma=1, shape=X_.shape[1])
4747
... sigma = pm.HalfNormal("sigma", sigma=1)
4848
... mu = pm.Deterministic("mu", pm.math.dot(X_, beta))
@@ -190,8 +190,8 @@ def build_model(self, X, y, coords):
190190
with self:
191191
self.add_coords(coords)
192192
n_predictors = X.shape[1]
193-
X = pm.MutableData("X", X, dims=["obs_ind", "coeffs"])
194-
y = pm.MutableData("y", y[:, 0], dims="obs_ind")
193+
X = pm.Data("X", X, dims=["obs_ind", "coeffs"])
194+
y = pm.Data("y", y[:, 0], dims="obs_ind")
195195
# TODO: There we should allow user-specified priors here
196196
beta = pm.Dirichlet("beta", a=np.ones(n_predictors), dims="coeffs")
197197
# beta = pm.Dirichlet(
@@ -245,8 +245,8 @@ def build_model(self, X, y, coords):
245245
"""
246246
with self:
247247
self.add_coords(coords)
248-
X = pm.MutableData("X", X, dims=["obs_ind", "coeffs"])
249-
y = pm.MutableData("y", y[:, 0], dims="obs_ind")
248+
X = pm.Data("X", X, dims=["obs_ind", "coeffs"])
249+
y = pm.Data("y", y[:, 0], dims="obs_ind")
250250
beta = pm.Normal("beta", 0, 50, dims="coeffs")
251251
sigma = pm.HalfNormal("sigma", 1)
252252
mu = pm.Deterministic("mu", pm.math.dot(X, beta), dims="obs_ind")

causalpy/tests/test_pymc_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def build_model(self, X, y, coords):
2222
This is a basic 1-variable linear regression model for use in tests.
2323
"""
2424
with self:
25-
X_ = pm.MutableData(name="X", value=X)
26-
y_ = pm.MutableData(name="y", value=y)
25+
X_ = pm.Data(name="X", value=X)
26+
y_ = pm.Data(name="y", value=y)
2727
beta = pm.Normal("beta", mu=0, sigma=1, shape=X_.shape[1])
2828
sigma = pm.HalfNormal("sigma", sigma=1)
2929
mu = pm.Deterministic("mu", pm.math.dot(X_, beta))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies = [
3434
"numpy<1.26.0",
3535
"pandas",
3636
"patsy",
37-
"pymc>=5.0.0",
37+
"pymc>=5.14.0",
3838
"scikit-learn>=1",
3939
"scipy",
4040
"seaborn>=0.11.2",

0 commit comments

Comments
 (0)