diff --git a/src/spe.py b/src/spe.py index f68fbd2..bde14f7 100644 --- a/src/spe.py +++ b/src/spe.py @@ -51,7 +51,7 @@ def memoize(f): def f_(*args): (spe, event_factor, memo) = args if memo is False: - return f(spe, event_factor_to_event, memo) + return f(spe, event_factor, memo) m = getattr(memo, table) key = spe.get_memo_key(event_factor) if key not in m: diff --git a/tests/test_product.py b/tests/test_product.py index 0e30e72..afd6319 100644 --- a/tests/test_product.py +++ b/tests/test_product.py @@ -73,7 +73,7 @@ def test_product_inclusion_exclusion_basic(): Y = Id('Y') spe = ProductSPE([X << norm(loc=0, scale=1), Y << gamma(a=1)]) - a = spe.logprob(X > 0.1) + a = spe.logprob(X > 0.1, memo=False) b = spe.logprob(Y < 0.5) c = spe.logprob((X > 0.1) & (Y < 0.5)) d = spe.logprob((X > 0.1) | (Y < 0.5)) @@ -120,7 +120,7 @@ def test_product_condition_basic(): # where the second clause reduces to first as Y < 0 # has probability zero. for event in [(X > 0), (X > 0) | (Y < 0)]: - dX = spe.condition(event) + dX = spe.condition(event, memo=False) assert isinstance(dX, ProductSPE) assert dX.children[0].symbol == Id('X') assert dX.children[0].conditioned