Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ZeroDivisionError when propagating with time zero #50
Actually if NUMBA_DISABLE_JIT is exported this appears as a maximum number of iterations error. Why does it change is a matter of study, but still the easiest way to fix it is to contemplate the special case of time = 0.0 at the very beginning of the
The problem lies in the relative tolerance checking in the algorithm:
For values near zero (or equal to zero, as in this case) the check fails. An absolute tolerance check would be more appropriate in this case to make the algorithm more robust (see for example https://www.python.org/dev/peps/pep-0485/ for a well thought implementation coming in Python 3.5).
Therefore, there are two solutions for the problem:
Regarding the different behavior when numba jitting is enabled or not, I guess it has to do with that same check. Perhaps it treats division differently (i.e. not in "NumPy mode") and a
Notice also that in original reports by @AunSiro (Python 3) the exact message was
Further checking is needed.