Skip to content

Commit

Permalink
Numpy testing for decomposition
Browse files Browse the repository at this point in the history
  • Loading branch information
kvanderwijst authored Feb 13, 2020
1 parent 2eb08fc commit 8bddb7f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def decomposition(n, values_start, values_end):

effect[i] += contribution_level

value_start = np.prod(values_start)
value_end = np.prod(values_end)

np.testing.assert_almost_equal(np.sum(effect), value_end - value_start)

return {
'value_start': np.prod(values_start),
'value_end': np.prod(values_end),
Expand Down

0 comments on commit 8bddb7f

Please sign in to comment.