Clip small negative values in van_rossum_distance before np.sqrt
This PR fixes Issue #679 . Currently van_rossum_distance could return nan due to extremely small negative values because of floating point errors before applying np.sqrt.
Fix
Added check before np.sqrt to find small negative values, then replaced them using np.maximum(vr_dist,0). Also outputs runtime warning for transparancy.
This ensures that spike trains that should result in a distance of 0 no longer produce nan.
Test
Added unit test that reproduces the spike train scenario from the issue, it asserts that the computed distance is 0 and not nan
coverage: 88.289% (+0.006%) from 88.283% when pulling cd3f15fa452b63d7ab285b8c1539bbae1b489f91 on INM-6:fix/van-rossum-nan into 867a0fcb103923d0013edc4269aa4479acbbdc1a on NeuralEnsemble:master.
The implementation looks good. I made small suggestions to improve the warnings and structure of the unit test.