Skip to content

Commit

Permalink
Fix #118: event_factor_to_event -> event_factor typo in spe.memoize
Browse files Browse the repository at this point in the history
  • Loading branch information
Feras A. Saad committed Jan 5, 2022
1 parent fa8670d commit 6017f97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/spe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6017f97

Please sign in to comment.