Skip to content

Commit 427f31c

Browse files
Deprecate generator data
1 parent cf78a4c commit 427f31c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pymc/pytensorf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ def convert_observed_data(data) -> np.ndarray | Variable:
8989

9090

9191
def convert_generator_data(data) -> TensorVariable:
92+
warnings.warn(
93+
"Generator data is deprecated and we intend to remove it."
94+
" If you disagree and need this, please get in touch via https://github.com/pymc-devs/pymc/issues.",
95+
DeprecationWarning,
96+
stacklevel=2,
97+
)
9298
return generator(data)
9399

94100

tests/test_pytensorf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ def test_convert_generator_data(input_dtype):
262262

263263
# Output is NOT wrapped with `pm.floatX`/`intX`,
264264
# but produced from calling a special Op.
265-
result = convert_generator_data(square_generator)
265+
with pytest.warns(DeprecationWarning, match="get in touch"):
266+
result = convert_generator_data(square_generator)
266267
apply = result.owner
267268
op = apply.op
268269
# Make sure the returned object is an PyTensor TensorVariable

0 commit comments

Comments
 (0)