diff --git a/docs/source/api/data.rst b/docs/source/api/data.rst index fe70e2d7f1..20f9ce4809 100644 --- a/docs/source/api/data.rst +++ b/docs/source/api/data.rst @@ -6,8 +6,6 @@ Data .. autosummary:: :toctree: generated/ - ConstantData - MutableData - get_data Data + get_data Minibatch diff --git a/pymc/gp/hsgp_approx.py b/pymc/gp/hsgp_approx.py index cf889aadd1..1b147eb9e2 100644 --- a/pymc/gp/hsgp_approx.py +++ b/pymc/gp/hsgp_approx.py @@ -620,7 +620,7 @@ def prior_linearized(self, X: TensorLike): they may share the same basis. Correct results when using `prior_linearized` in tandem with - `pm.set_data` and `pm.MutableData` require that the `Xs` are + `pm.set_data` and `pm.Data` require that the `Xs` are zero-centered, so its mean must be subtracted. An example is given below. diff --git a/pymc/sampling/forward.py b/pymc/sampling/forward.py index d1703e82a3..f7d48af446 100644 --- a/pymc/sampling/forward.py +++ b/pymc/sampling/forward.py @@ -607,8 +607,8 @@ def sample_posterior_predictive( import pymc as pm - with pm.Model(coords_mutable={"trial": [0, 1, 2]}) as model: - x = pm.MutableData("x", [-1, 0, 1], dims=["trial"]) + with pm.Model(coords={"trial": [0, 1, 2]}) as model: + x = pm.Data("x", [-1, 0, 1], dims=["trial"]) beta = pm.Normal("beta") noise = pm.HalfNormal("noise") y = pm.Normal("y", mu=x * beta, sigma=noise, observed=[-2, 0, 3], dims=["trial"]) @@ -634,8 +634,8 @@ def sample_posterior_predictive( .. code-block:: python - with pm.Model(coords_mutable={"trial": [3, 4]}) as predictions_model: - x = pm.MutableData("x", [-2, 2], dims=["trial"]) + with pm.Model(coords={"trial": [3, 4]}) as predictions_model: + x = pm.Data("x", [-2, 2], dims=["trial"]) beta = pm.Normal("beta") noise = pm.HalfNormal("noise") y = pm.Normal("y", mu=x * beta, sigma=noise, dims=["trial"]) @@ -651,8 +651,8 @@ def sample_posterior_predictive( .. code-block:: python - with pm.Model(coords_mutable={"trial": [3, 4]}) as distinct_predictions_model: - x = pm.MutableData("x", [-2, 2], dims=["trial"]) + with pm.Model(coords={"trial": [3, 4]}) as distinct_predictions_model: + x = pm.Data("x", [-2, 2], dims=["trial"]) beta = pm.Normal("beta") noise = pm.HalfNormal("noise") extra_noise = pm.HalfNormal("extra_noise", sigma=noise) diff --git a/tests/sampling/test_forward.py b/tests/sampling/test_forward.py index 3dd30e14f7..cfb8bf73db 100644 --- a/tests/sampling/test_forward.py +++ b/tests/sampling/test_forward.py @@ -1022,7 +1022,7 @@ def test_logging_sampled_basic_rvs_posterior_mutable(self, mock_sample_results, caplog.clear() elif kind == "Dataset": # Dataset has all MCMC posterior samples and the values of the coordinates. This - # enables it to see that the coordinates have not changed, but the MutableData is + # enables it to see that the coordinates have not changed, but the Data is # assumed volatile by default assert caplog.record_tuples == [ ("pymc.sampling.forward", logging.INFO, "Sampling: [b, y]") @@ -1031,7 +1031,7 @@ def test_logging_sampled_basic_rvs_posterior_mutable(self, mock_sample_results, original_offsets = model["offsets"].get_value() with model: - # Changing the MutableData values. This will only be picked up by InferenceData + # Changing the Data values. This will only be picked up by InferenceData pm.set_data({"offsets": original_offsets + 1}) pm.sample_posterior_predictive(samples) if kind == "MultiTrace": @@ -1072,7 +1072,7 @@ def test_logging_sampled_basic_rvs_posterior_mutable(self, mock_sample_results, caplog.clear() with model: - # Changing the mutable coordinate values, but not shape, and also changing MutableData. + # Changing the mutable coordinate values, but not shape, and also changing Data. # This will trigger resampling of all variables model.set_dim("name", new_length=3, coord_values=["A", "B", "D"]) pm.set_data({"offsets": original_offsets + 1, "y_obs": np.zeros((10, 3))})