[Yt-svn] commit/yt: MatthewTurk: Turn off numpy error reporting by default, and unless the loglevel is high.

Bitbucket commits-noreply at bitbucket.org
Wed Nov 9 14:32:19 PST 2011


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/319900e9eaf7/
changeset:   319900e9eaf7
branch:      yt
user:        MatthewTurk
date:        2011-11-09 23:29:35
summary:     Turn off numpy error reporting by default, and unless the loglevel is high.
affected #:  1 file

diff -r c83c0ec05170fe71d142ca6c16230a99ce06a37f -r 319900e9eaf7866085f7bc38ce56f38cf32d8bbe yt/mods.py
--- a/yt/mods.py
+++ b/yt/mods.py
@@ -38,9 +38,15 @@
 from yt.funcs import *
 from yt.utilities.logger import ytLogger as mylog
 from yt.utilities.performance_counters import yt_counters, time_function
-from yt.config import ytcfg
+from yt.config import ytcfg, ytcfgDefaults
 import yt.utilities.physical_constants as physical_constants
 
+from yt.utilities.logger import level as __level
+if __level >= int(ytcfgDefaults["loglevel"]):
+    # This won't get displayed.
+    mylog.debug("Turning off NumPy error reporting")
+    na.seterr(all = 'ignore')
+
 from yt.data_objects.api import \
     BinnedProfile1D, BinnedProfile2D, BinnedProfile3D, \
     data_object_registry, \

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list