Please use new python test framework.
No, because I've no idea what it is.
C translation available.
Couldn't you use the new test framework for that?
awesome! it's been so long since I wrote this I'd completely forgotten about it. thanks for adding Python (one of my favorites)!
Added in python. :D
No random tests.
The expected result should be 0.2. The affinity, for this exercise, considers both values and their indices.
One question. What is the expected result if we have two vectors : [3,2,1], [1,2,3,4,5] (first test case modified). What is the expected affinity? 0.2 or 0.6?
Ah I see. Thanks!
yonax, you uncovered a nasty bug. I have fixed it and added the test cases discussed above to the kata.
This was due to an issue in my logic for solving the problem. It has been corrected, and the kata has been republished.
vector_affinity([None], ) == 0.0 => True