Skip to content

Commit 50cf028

Browse files
committed
Return empty list of measurable outputs from UnmeasurableVariables instead of None
1 parent 8ea8b3b commit 50cf028

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pymc/logprob/abstract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _get_measurable_outputs_RandomVariable(op, node):
174174

175175

176176
def noop_measurable_outputs_fn(*args, **kwargs):
177-
return None
177+
return []
178178

179179

180180
def assign_custom_measurable_outputs(

pymc/tests/distributions/test_logprob.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def test_ignore_logprob_basic():
325325
assert isinstance(new_x.owner.op, Normal)
326326
assert type(new_x.owner.op).__name__ == "UnmeasurableNormalRV"
327327
# Confirm that it does not have measurable output
328-
assert get_measurable_outputs(new_x.owner.op, new_x.owner) is None
328+
assert get_measurable_outputs(new_x.owner.op, new_x.owner) == []
329329

330330
# Test that it will not clone a variable that is already unmeasurable
331331
new_new_x = ignore_logprob(new_x)

0 commit comments

Comments
 (0)