Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/source/api/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Data
.. autosummary::
:toctree: generated/

ConstantData
MutableData
get_data
Data
get_data
Minibatch
2 changes: 1 addition & 1 deletion pymc/gp/hsgp_approx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions pymc/sampling/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand All @@ -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"])
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions tests/sampling/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
Expand All @@ -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":
Expand Down Expand Up @@ -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))})
Expand Down