rlabbe / filterpy

Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
MIT License
3.23k stars 614 forks source link

Fix test by relaxing near_eq (from 1e-18 to 1e-17) #217

Closed pgdr closed 3 years ago

pgdr commented 3 years ago

In Python 3.8.6 at Ubuntu, test_linear_ode from filterpy/common/tests/test_discretization.py fails with

>       assert near_eq(Q[0,4], (1./6)*(dt**3)*q)
E       assert False
E        +  where False = near_eq(0.004166666666666665, (((1.0 / 6) * (0.5 ** 3)) * 0.2))

I'm not sure why near_eq needs this tight bounds, even 1e-15 could be good enough.