mirror image notebook: RuntimeWarning: divide by zero
mgeier opened this issue · 1 comments
mgeier commented
Currently, there are several ugly warnings in this notebook: http://python.sfstoolbox.org/en/latest/examples/mirror-image-source-model.html
That's the first bunch:
/home/docs/checkouts/readthedocs.org/user_builds/sfs-python/conda/latest/lib/python3.7/site-packages/sfs/mono/source.py:85: RuntimeWarning: divide by zero encountered in true_divide
return 1 / (4*np.pi) * np.exp(-1j * k * r) / r
/home/docs/checkouts/readthedocs.org/user_builds/sfs-python/conda/latest/lib/python3.7/site-packages/sfs/mono/source.py:85: RuntimeWarning: invalid value encountered in true_divide
return 1 / (4*np.pi) * np.exp(-1j * k * r) / r
/home/docs/checkouts/readthedocs.org/user_builds/sfs-python/conda/latest/lib/python3.7/site-packages/sfs/mono/source.py:398: RuntimeWarning: invalid value encountered in multiply
p += strength * point(omega, position, grid, c)
And two more further down:
/home/docs/checkouts/readthedocs.org/user_builds/sfs-python/conda/latest/lib/python3.7/site-packages/sfs/time/source.py:82: RuntimeWarning: divide by zero encountered in true_divide
weights = 1 / (4 * np.pi * r)
/home/docs/checkouts/readthedocs.org/user_builds/sfs-python/conda/latest/lib/python3.7/site-packages/sfs/time/source.py:87: RuntimeWarning: invalid value encountered in multiply
data, left=0, right=0)
It would be nice to get rid of those warnings.
If the division by zero is justified, we should silence the warning.
One example for ignoring a warning:
Lines 388 to 389 in d4ac310
Another one:
Lines 366 to 367 in d4ac310