[yt-svn] commit/yt: 4 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue May 21 16:54:50 PDT 2013


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/3200f58ed8e7/
Changeset:   3200f58ed8e7
Branch:      yt
User:        ngoldbaum
Date:        2013-05-21 03:05:44
Summary:     Adding a catch for plots of all-zero arrays.  Closes #572

Currently these sorts of plots will crash if the colorbar is logarithmic.  This
forces a switch to a linear colorbar to avoid the crash.
Affected #:  1 file

diff -r ff04cead07c8458eb61da8f49fb7e9fb7b652d10 -r 3200f58ed8e723f8668ad18e201762739cd56396 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -880,6 +880,12 @@
 
             image = self._frb[f]
 
+            if image.max() == image.min() == 0:
+                if self._field_transform[f] == log_transform:
+                    mylog.warning("Buffer values for field %s are zero everywhere. " % f)
+                    mylog.warning("Switching from logarithmic to linear colorbar scaling")
+                    self._field_transform[f] = linear_transform
+            
             fp = self._font_properties
 
             self.plots[f] = WindowPlotMPL(image, self._field_transform[f].name,


https://bitbucket.org/yt_analysis/yt/commits/9f376fa6cbcd/
Changeset:   9f376fa6cbcd
Branch:      yt
User:        ngoldbaum
Date:        2013-05-21 21:39:18
Summary:     Checking for a more general case where max = min but is not necessarily 0.
Affected #:  1 file

diff -r 3200f58ed8e723f8668ad18e201762739cd56396 -r 9f376fa6cbcdc44cd879305d596549b4648b0416 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -880,12 +880,14 @@
 
             image = self._frb[f]
 
-            if image.max() == image.min() == 0:
+            if image.max() == image.min():
                 if self._field_transform[f] == log_transform:
-                    mylog.warning("Buffer values for field %s are zero everywhere. " % f)
-                    mylog.warning("Switching from logarithmic to linear colorbar scaling")
+                    mylog.warning("Plot image for field %s has zero dynamic " \
+                                  "range. Min = Max = %d." % \
+                                  (f, image.max()))
+                    mylog.warning("Switching to linear colorbar scaling.")
                     self._field_transform[f] = linear_transform
-            
+
             fp = self._font_properties
 
             self.plots[f] = WindowPlotMPL(image, self._field_transform[f].name,


https://bitbucket.org/yt_analysis/yt/commits/56092b9210bd/
Changeset:   56092b9210bd
Branch:      yt
User:        ngoldbaum
Date:        2013-05-21 21:50:15
Summary:     Collapsing a nested conditional.
Affected #:  1 file

diff -r 9f376fa6cbcdc44cd879305d596549b4648b0416 -r 56092b9210bd5e54705932861be28f4747c45c62 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -880,13 +880,12 @@
 
             image = self._frb[f]
 
-            if image.max() == image.min():
-                if self._field_transform[f] == log_transform:
-                    mylog.warning("Plot image for field %s has zero dynamic " \
-                                  "range. Min = Max = %d." % \
-                                  (f, image.max()))
-                    mylog.warning("Switching to linear colorbar scaling.")
-                    self._field_transform[f] = linear_transform
+            if image.max() == image.min() and self._field_transform[f] == log_transform:
+                mylog.warning("Plot image for field %s has zero dynamic " \
+                              "range. Min = Max = %d." % \
+                              (f, image.max()))
+                mylog.warning("Switching to linear colorbar scaling.")
+                self._field_transform[f] = linear_transform
 
             fp = self._font_properties
 


https://bitbucket.org/yt_analysis/yt/commits/c95fc126f379/
Changeset:   c95fc126f379
Branch:      yt
User:        MatthewTurk
Date:        2013-05-22 01:54:41
Summary:     Merged in ngoldbaum/yt (pull request #506)

Adding a catch that enables plots of arrays with zero dynamic range.  Closes #572
Affected #:  1 file

diff -r 508e6bd26c885ed74fe3279f5a40dcb77ca95b49 -r c95fc126f379d852d59430e7e9d0a405be607ce2 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -880,6 +880,13 @@
 
             image = self._frb[f]
 
+            if image.max() == image.min() and self._field_transform[f] == log_transform:
+                mylog.warning("Plot image for field %s has zero dynamic " \
+                              "range. Min = Max = %d." % \
+                              (f, image.max()))
+                mylog.warning("Switching to linear colorbar scaling.")
+                self._field_transform[f] = linear_transform
+
             fp = self._font_properties
 
             self.plots[f] = WindowPlotMPL(image, self._field_transform[f].name,

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