|
14 | 14 |
|
15 | 15 | import io |
16 | 16 | import urllib.request |
17 | | -import warnings |
18 | 17 |
|
19 | 18 | from collections.abc import Sequence |
20 | 19 | from copy import copy |
|
40 | 39 | from pymc.vartypes import isgenerator |
41 | 40 |
|
42 | 41 | __all__ = [ |
43 | | - "ConstantData", |
44 | 42 | "Data", |
45 | 43 | "Minibatch", |
46 | | - "MutableData", |
47 | 44 | "get_data", |
48 | 45 | ] |
49 | 46 | BASE_URL = "https://raw.githubusercontent.com/pymc-devs/pymc-examples/main/examples/data/{filename}" |
@@ -218,74 +215,13 @@ def determine_coords( |
218 | 215 | return coords, new_dims |
219 | 216 |
|
220 | 217 |
|
221 | | -def ConstantData( |
222 | | - name: str, |
223 | | - value, |
224 | | - *, |
225 | | - dims: Sequence[str] | None = None, |
226 | | - coords: dict[str, Sequence | np.ndarray] | None = None, |
227 | | - infer_dims_and_coords=False, |
228 | | - **kwargs, |
229 | | -) -> TensorConstant: |
230 | | - """Alias for ``pm.Data``. |
231 | | -
|
232 | | - Registers the ``value`` as a :class:`~pytensor.tensor.TensorConstant` with the model. |
233 | | - For more information, please reference :class:`pymc.Data`. |
234 | | - """ |
235 | | - warnings.warn( |
236 | | - "ConstantData is deprecated. All Data variables are now mutable. Use Data instead.", |
237 | | - FutureWarning, |
238 | | - ) |
239 | | - |
240 | | - var = Data( |
241 | | - name, |
242 | | - value, |
243 | | - dims=dims, |
244 | | - coords=coords, |
245 | | - infer_dims_and_coords=infer_dims_and_coords, |
246 | | - **kwargs, |
247 | | - ) |
248 | | - return cast(TensorConstant, var) |
249 | | - |
250 | | - |
251 | | -def MutableData( |
252 | | - name: str, |
253 | | - value, |
254 | | - *, |
255 | | - dims: Sequence[str] | None = None, |
256 | | - coords: dict[str, Sequence | np.ndarray] | None = None, |
257 | | - infer_dims_and_coords=False, |
258 | | - **kwargs, |
259 | | -) -> SharedVariable: |
260 | | - """Alias for ``pm.Data``. |
261 | | -
|
262 | | - Registers the ``value`` as a :class:`~pytensor.compile.sharedvalue.SharedVariable` |
263 | | - with the model. For more information, please reference :class:`pymc.Data`. |
264 | | - """ |
265 | | - warnings.warn( |
266 | | - "MutableData is deprecated. All Data variables are now mutable. Use Data instead.", |
267 | | - FutureWarning, |
268 | | - ) |
269 | | - |
270 | | - var = Data( |
271 | | - name, |
272 | | - value, |
273 | | - dims=dims, |
274 | | - coords=coords, |
275 | | - infer_dims_and_coords=infer_dims_and_coords, |
276 | | - **kwargs, |
277 | | - ) |
278 | | - return cast(SharedVariable, var) |
279 | | - |
280 | | - |
281 | 218 | def Data( |
282 | 219 | name: str, |
283 | 220 | value, |
284 | 221 | *, |
285 | 222 | dims: Sequence[str] | None = None, |
286 | 223 | coords: dict[str, Sequence | np.ndarray] | None = None, |
287 | 224 | infer_dims_and_coords=False, |
288 | | - mutable: bool | None = None, |
289 | 225 | **kwargs, |
290 | 226 | ) -> SharedVariable | TensorConstant: |
291 | 227 | """Create a data container that registers a data variable with the model. |
@@ -380,11 +316,6 @@ def Data( |
380 | 316 | "Pass them directly to `observed` if you want to trigger auto-imputation" |
381 | 317 | ) |
382 | 318 |
|
383 | | - if mutable is not None: |
384 | | - warnings.warn( |
385 | | - "Data is now always mutable. Specifying the `mutable` kwarg will raise an error in a future release", |
386 | | - FutureWarning, |
387 | | - ) |
388 | 319 | x = pytensor.shared(arr, name, **kwargs) |
389 | 320 |
|
390 | 321 | if isinstance(dims, str): |
|
0 commit comments