Skip to content

Commit 0c53df5

Browse files
pm.MutableData -> pm.Data
1 parent b21b955 commit 0c53df5

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

pymc_experimental/linearmodel.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def build_model(self, X: pd.DataFrame, y: pd.Series):
6969

7070
# Data array size can change but number of dimensions must stay the same.
7171
with pm.Model() as self.model:
72-
x = pm.MutableData("x", np.zeros((1,)), dims="observation")
73-
y_data = pm.MutableData("y_data", np.zeros((1,)), dims="observation")
72+
x = pm.Data("x", np.zeros((1,)), dims="observation")
73+
y_data = pm.Data("y_data", np.zeros((1,)), dims="observation")
7474

7575
# priors
7676
intercept = pm.Normal(

pymc_experimental/statespace/core/statespace.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def _print_data_requirements(self) -> None:
291291
out = out.rstrip()
292292

293293
_log.info(
294-
"The following MutableData variables should be assigned to the model inside a PyMC "
294+
"The following Data variables should be assigned to the model inside a PyMC "
295295
f"model block: \n"
296296
f"{out}"
297297
)
@@ -366,7 +366,7 @@ def param_info(self) -> dict[str, dict[str, Any]]:
366366
@property
367367
def data_info(self) -> dict[str, dict[str, Any]]:
368368
"""
369-
Information about MutableData variables that need to be declared in the PyMC model block.
369+
Information about Data variables that need to be declared in the PyMC model block.
370370
371371
Returns a dictionary of data_name: dictionary of property-name:property description pairs. The return value is
372372
used by the ``_print_data_requirements`` method, to print a message telling users how to define the necessary
@@ -877,7 +877,7 @@ def build_statespace_graph(
877877
or a Pytensor tensor variable.
878878
879879
register_data : bool, optional, default=True
880-
If True, the observed data will be registered with PyMC as a pm.MutableData variable. In addition,
880+
If True, the observed data will be registered with PyMC as a pm.Data variable. In addition,
881881
a "time" dim will be created an added to the model's coords.
882882
883883
mode : Optional[str], optional, default=None

pymc_experimental/tests/model/test_marginal_model.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ def test_is_conditional_dependent_static_shape():
609609
def test_data_container():
610610
"""Test that MarginalModel can handle Data containers."""
611611
with MarginalModel(coords_mutable={"obs": [0]}) as marginal_m:
612-
x = pm.MutableData("x", 2.5)
612+
x = pm.Data("x", 2.5)
613613
idx = pm.Bernoulli("idx", p=0.7, dims="obs")
614614
y = pm.Normal("y", idx * x, dims="obs")
615615

@@ -618,7 +618,7 @@ def test_data_container():
618618
logp_fn = marginal_m.compile_logp()
619619

620620
with pm.Model(coords_mutable={"obs": [0]}) as m_ref:
621-
x = pm.MutableData("x", 2.5)
621+
x = pm.Data("x", 2.5)
622622
y = pm.NormalMixture("y", w=[0.3, 0.7], mu=[0, x], dims="obs")
623623

624624
ref_logp_fn = m_ref.compile_logp()

pymc_experimental/tests/statespace/test_distributions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_lgss_with_time_varying_inputs(output_name, rng):
172172
}
173173

174174
with pm.Model(coords=coords):
175-
exog_data = pm.MutableData("data_exog", X)
175+
exog_data = pm.Data("data_exog", X)
176176
P0_diag = pm.Exponential("P0_diag", 1, shape=(mod.k_states,))
177177
P0 = pm.Deterministic("P0", pt.diag(P0_diag))
178178
initial_trend = pm.Normal("initial_trend", shape=(2,))

pymc_experimental/tests/statespace/test_statespace.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def exog_pymc_mod(exog_ss_mod, rng):
117117
X = rng.normal(size=(100, 3)).astype(floatX)
118118

119119
with pm.Model(coords=exog_ss_mod.coords) as m:
120-
exog_data = pm.MutableData("data_exog", X)
120+
exog_data = pm.Data("data_exog", X)
121121
initial_trend = pm.Normal("initial_trend", dims=["trend_state"])
122122
P0_sigma = pm.Exponential("P0_sigma", 1)
123123
P0 = pm.Deterministic(

pymc_experimental/tests/statespace/test_structural.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ def test_filter_scans_time_varying_design_matrix(rng):
750750
mod = reg.build(verbose=False)
751751

752752
with pm.Model(coords=mod.coords) as m:
753-
data_exog = pm.MutableData("data_exog", data.values)
753+
data_exog = pm.Data("data_exog", data.values)
754754

755755
x0 = pm.Normal("x0", dims=["state"])
756756
P0 = pm.Deterministic("P0", pt.eye(mod.k_states), dims=["state", "state_aux"])
@@ -781,7 +781,7 @@ def test_extract_components_from_idata(rng):
781781
mod = (ll + season + reg + me).build(verbose=False)
782782

783783
with pm.Model(coords=mod.coords) as m:
784-
data_exog = pm.MutableData("data_exog", data.values)
784+
data_exog = pm.Data("data_exog", data.values)
785785

786786
x0 = pm.Normal("x0", dims=["state"])
787787
P0 = pm.Deterministic("P0", pt.eye(mod.k_states), dims=["state", "state_aux"])

pymc_experimental/tests/test_model_builder.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ def build_model(self, X: pd.DataFrame, y: pd.Series, model_config=None):
100100
with pm.Model(coords=coords) as self.model:
101101
if model_config is None:
102102
model_config = self.model_config
103-
x = pm.MutableData("x", self.X["input"].values)
104-
y_data = pm.MutableData("y_data", self.y)
103+
x = pm.Data("x", self.X["input"].values)
104+
y_data = pm.Data("y_data", self.y)
105105

106106
# prior parameters
107107
a_loc = model_config["a"]["loc"]

0 commit comments

Comments
 (0)