
Nov. 9, 2010
11:34 a.m.
Hi, I have write quite a large program, but I occationally get the following warning message: Warning: invalid value encountered in sqrt The programs runs for several hours finding the hyperparameters of a Gaussian Process, but occationally this warning pop up. Maybe due tue rounding errors or maybe because some numbers become nan. Can I make the program stop instead of just giving a warning, so that I get a traceback to where it comes from? For example in IPython: In [4]: def test(): ...: np.sqrt(-1) ...: np.sqrt(-1) ...: In [5]: test() Warning: invalid value encountered in sqrt Warning: invalid value encountered in sqrt Gives the warning two times instead of stopping. Best regard, Jóan Petur Petersen