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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Jul 10 18:19:58 PDT 2015


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/5f4806a65c3d/
Changeset:   5f4806a65c3d
Branch:      yt
User:        jzuhone
Date:        2015-07-10 19:45:05+00:00
Summary:     Bug fixes for particle plots.

1) Need to make sure we are getting the units of depth set correctly.
2) The axes unit needs to be specified by the width before we do anything to it.
3) Should decide where to divide by the weight field when it is greater than zero, not the field being projected.
Affected #:  2 files

diff -r 7d4877bae33a4739b0f46c78a11eac5b7db711c1 -r 5f4806a65c3ddb3b8b278c5f1af6334cbaafed40 yt/visualization/fixed_resolution.py
--- a/yt/visualization/fixed_resolution.py
+++ b/yt/visualization/fixed_resolution.py
@@ -564,7 +564,7 @@
                                       input_units=weight_data.units,
                                       info=self._get_info(item))
 
-            locs = np.where(ia > 0)
+            locs = np.where(weight_array > 0)
             ia[locs] /= weight_array[locs]
 
         self.data[item] = ia

diff -r 7d4877bae33a4739b0f46c78a11eac5b7db711c1 -r 5f4806a65c3ddb3b8b278c5f1af6334cbaafed40 yt/visualization/particle_plots.py
--- a/yt/visualization/particle_plots.py
+++ b/yt/visualization/particle_plots.py
@@ -205,6 +205,9 @@
         if field_parameters is None:
             field_parameters = {}
 
+        if axes_unit is None:
+            axes_unit = get_axes_unit(width, ds)
+
         # if no fields are passed in, we simply mark the x and
         # y fields using a given color. Use the 'particle_ones'
         # field to do this. We also turn off the colorbar in
@@ -225,7 +228,7 @@
         width = np.zeros_like(center)
         width[x_coord] = bounds[1] - bounds[0]
         width[y_coord] = bounds[3] - bounds[2]
-        width[axis] = depth[0]
+        width[axis] = depth[0].in_units(width[x_coord].units)
 
         ParticleSource = ParticleAxisAlignedDummyDataSource(center, ds, axis,
                                         width, fields, weight_field,
@@ -236,8 +239,7 @@
                              fontsize=fontsize, fields=fields,
                              window_size=window_size, aspect=aspect,
                              splat_color=splat_color)
-        if axes_unit is None:
-            axes_unit = get_axes_unit(width, ds)
+
         self.set_axes_unit(axes_unit)
 
         if self._use_cbar is False:


https://bitbucket.org/yt_analysis/yt/commits/b34ec79bbd55/
Changeset:   b34ec79bbd55
Branch:      yt
User:        chummels
Date:        2015-07-11 01:19:52+00:00
Summary:     Merged in jzuhone/yt (pull request #1634)

[bugfix] Bug fixes for particle plots
Affected #:  2 files

diff -r f06003cb29f0f743c02cd8543da8385787151677 -r b34ec79bbd55d2aa56e047de9dc67d0f4256699c yt/visualization/fixed_resolution.py
--- a/yt/visualization/fixed_resolution.py
+++ b/yt/visualization/fixed_resolution.py
@@ -564,7 +564,7 @@
                                       input_units=weight_data.units,
                                       info=self._get_info(item))
 
-            locs = np.where(ia > 0)
+            locs = np.where(weight_array > 0)
             ia[locs] /= weight_array[locs]
 
         self.data[item] = ia

diff -r f06003cb29f0f743c02cd8543da8385787151677 -r b34ec79bbd55d2aa56e047de9dc67d0f4256699c yt/visualization/particle_plots.py
--- a/yt/visualization/particle_plots.py
+++ b/yt/visualization/particle_plots.py
@@ -205,6 +205,9 @@
         if field_parameters is None:
             field_parameters = {}
 
+        if axes_unit is None:
+            axes_unit = get_axes_unit(width, ds)
+
         # if no fields are passed in, we simply mark the x and
         # y fields using a given color. Use the 'particle_ones'
         # field to do this. We also turn off the colorbar in
@@ -225,7 +228,7 @@
         width = np.zeros_like(center)
         width[x_coord] = bounds[1] - bounds[0]
         width[y_coord] = bounds[3] - bounds[2]
-        width[axis] = depth[0]
+        width[axis] = depth[0].in_units(width[x_coord].units)
 
         ParticleSource = ParticleAxisAlignedDummyDataSource(center, ds, axis,
                                         width, fields, weight_field,
@@ -236,8 +239,7 @@
                              fontsize=fontsize, fields=fields,
                              window_size=window_size, aspect=aspect,
                              splat_color=splat_color)
-        if axes_unit is None:
-            axes_unit = get_axes_unit(width, ds)
+
         self.set_axes_unit(axes_unit)
 
         if self._use_cbar is False:

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