Skip to content

Commit d5e493c

Browse files
authored
Merge pull request #291 from anevolbap/issue_288-warnings_tests
Fix #288: remove deprecated 'model' property in tests.
2 parents a63a7f9 + 60e537c commit d5e493c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

causalpy/pymc_models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _data_setter(self, X) -> None:
8989
This method is used internally to register new data for the model for
9090
prediction.
9191
"""
92-
with self.model:
92+
with self:
9393
pm.set_data({"X": X})
9494

9595
def fit(self, X, y, coords: Optional[Dict[str, Any]] = None) -> None:
@@ -105,7 +105,7 @@ def fit(self, X, y, coords: Optional[Dict[str, Any]] = None) -> None:
105105
random_seed = None
106106

107107
self.build_model(X, y, coords)
108-
with self.model:
108+
with self:
109109
self.idata = pm.sample(**self.sample_kwargs)
110110
self.idata.extend(pm.sample_prior_predictive(random_seed=random_seed))
111111
self.idata.extend(
@@ -125,7 +125,7 @@ def predict(self, X):
125125
"""
126126

127127
self._data_setter(X)
128-
with self.model: # sample with new input data
128+
with self: # sample with new input data
129129
post_pred = pm.sample_posterior_predictive(
130130
self.idata, var_names=["y_hat", "mu"], progressbar=False
131131
)
@@ -354,7 +354,7 @@ def fit(self, X, Z, y, t, coords, priors):
354354
distributions.
355355
"""
356356
self.build_model(X, Z, y, t, coords, priors)
357-
with self.model:
357+
with self:
358358
self.idata = pm.sample(**self.sample_kwargs)
359359
self.idata.extend(pm.sample_prior_predictive())
360360
self.idata.extend(

0 commit comments

Comments
 (0)