[yt-svn] commit/yt: ngoldbaum: Prevent field detection from printing numpy floating point error warnings.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Mar 26 07:09:43 PDT 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/cf406118daf0/
Changeset:   cf406118daf0
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-03-26 00:49:16
Summary:     Prevent field detection from printing numpy floating point error warnings.
Affected #:  2 files

diff -r 94fb98836a21f22f91e4d5524f2f0212e5caf161 -r cf406118daf0c426c651e2b906e6da8d4cb013d4 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -279,7 +279,10 @@
                 self, dataset_type=self.dataset_type)
             # Now we do things that we need an instantiated index for
             # ...first off, we create our field_info now.
+            oldsettings = np.geterr()
+            np.seterr(all='ignore')
             self.create_field_info()
+            np.seterr(**oldsettings)
         return self._instantiated_index
     
     _index_proxy = None

diff -r 94fb98836a21f22f91e4d5524f2f0212e5caf161 -r cf406118daf0c426c651e2b906e6da8d4cb013d4 yt/fields/field_detector.py
--- a/yt/fields/field_detector.py
+++ b/yt/fields/field_detector.py
@@ -188,6 +188,8 @@
             return rv
         elif param == "fof_groups":
             return None
+        elif param == "mu":
+            return 1.0
         else:
             return 0.0

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