AIFDR/risk_in_a_box — Issue #27: Ignore division by zero in engine
Author: uniomni
Created: 2012-01-17 00:33:59+00:00
State: open

From Python 2.7, numpy is producing annoying warnings ilke

Warning: divide by zero encountered in log
Warning: invalid value encountered in multiply
..............Warning: invalid value encountered in divide
Warning: invalid value encountered in divide
Warning: invalid value encountered in divide

As these result in NaN values as planned I suggest we suppress them using numpy.seterr:
np.seterr(divide='ignore') # Or possibly np.seterr(invalid='ignore')

See e.g.http://stackoverflow.com/questions/5556919/fixing-the-singularity-of-a-function