[yt-svn] commit/yt: ngoldbaum: (hopefully) fix unit test failures on test machine.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Jul 18 20:10:29 PDT 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/bef034f129c6/
Changeset:   bef034f129c6
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-19 05:09:16
Summary:     (hopefully) fix unit test failures on test machine.
Affected #:  3 files

diff -r b04c9b3692db47c99a367f0decda46fcbbca3801 -r bef034f129c62f5b85555345a754625b59efe3fb yt/utilities/grid_data_format/writer.py
--- a/yt/utilities/grid_data_format/writer.py
+++ b/yt/utilities/grid_data_format/writer.py
@@ -227,7 +227,7 @@
         if unit_name in dataset_units:
             value, units = dataset_units[unit_name]
         else:
-            attr = getattr(pf, unit_name)
+            attr = getattr(ds, unit_name)
             value = float(attr)
             units = str(attr.units)
         d = g.create_dataset(unit_name, data=value)

diff -r b04c9b3692db47c99a367f0decda46fcbbca3801 -r bef034f129c62f5b85555345a754625b59efe3fb yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -807,10 +807,10 @@
                     pass
                 elif np.nanmax(image) == np.nanmin(image):
                     msg = "Plot image for field %s has zero dynamic " \
-                          "range. Min = Max = %d." % (f, np.nanmax(image))
+                          "range. Min = Max = %f." % (f, np.nanmax(image))
                 elif np.nanmax(image) <= 0:
                     msg = "Plot image for field %s has no positive " \
-                          "values.  Max = %d." % (f, np.nanmax(image))
+                          "values.  Max = %f." % (f, np.nanmax(image))
                 elif not np.any(np.isfinite(image)):
                     msg = "Plot image for field %s is filled with NaNs." % (f,)
                 if msg is not None:

diff -r b04c9b3692db47c99a367f0decda46fcbbca3801 -r bef034f129c62f5b85555345a754625b59efe3fb yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -797,19 +797,19 @@
                     positive_values = data[data > 0.0]
                     if len(positive_values) == 0:
                         mylog.warning("Profiled field %s has no positive "
-                                      "values.  Max = %d." %
+                                      "values.  Max = %f." %
                                       (f, np.nanmax(data)))
                         mylog.warning("Switching to linear colorbar scaling.")
-                        zmin = data.min()
+                        zmin = np.nanmin(data)
                         z_scale = 'linear'
                         self._field_transform[f] = linear_transform
                     else:
                         zmin = positive_values.min()
                         self._field_transform[f] = log_transform
                 else:
-                    zmin = data.min()
+                    zmin = np.nanmin(data)
                     self._field_transform[f] = linear_transform
-                zlim = [zmin, data.max()]
+                zlim = [zmin, np.nanmax(data)]
 
             fp = self._font_properties
             f = self.profile.data_source._determine_fields(f)[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