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

Bitbucket commits-noreply at bitbucket.org
Sun Sep 2 14:57:17 PDT 2012


4 new commits in yt:


https://bitbucket.org/yt_analysis/yt/changeset/9ee80a7e4bb4/
changeset:   9ee80a7e4bb4
branch:      yt
user:        xarthisius
date:        2012-08-31 15:07:50
summary:     Draw grid ids only on the highest available level of refinement
affected #:  1 file

diff -r 327b4358244afdbf8507002e02c79d4ea9b3dd1d -r 9ee80a7e4bb4432b46cd29b46f0e0deea7e505ea yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -348,9 +348,13 @@
             plot._axes.hold(True)
             plot._axes.add_collection(grid_collection)
             if self.draw_ids:
-                ids = [g.id for g in plot.data._grids]
-                for n in visible.nonzero()[0]:
-                    plot._axes.text(left_edge_x[n]+(2*(xx1-xx0)/xpix),left_edge_y[n]+(2*(yy1-yy0)/ypix),ids[n],clip_on=True)
+                visible_gids = visible.nonzero()[0]
+                ids = [g.id for g in plot.data._grids
+                       if na.any(g.child_mask) and g.id in visible_gids]
+                for gid in ids:
+                    plot._axes.text(left_edge_x[gid] + (2 * (xx1 - xx0) / xpix),
+                                    left_edge_y[gid] + (2 * (yy1 - yy0) / ypix),
+                                    gid, clip_on=True)
             plot._axes.hold(False)
 
 class StreamlineCallback(PlotCallback):



https://bitbucket.org/yt_analysis/yt/changeset/8a7c75b0a9c7/
changeset:   8a7c75b0a9c7
branch:      yt
user:        xarthisius
date:        2012-08-31 18:26:30
summary:     Check size of AMRPatch.Children instead of doing logical operation on AMRPatch.child_mask. Thanks to Matt for the tip
affected #:  1 file

diff -r 9ee80a7e4bb4432b46cd29b46f0e0deea7e505ea -r 8a7c75b0a9c75976bc58bf2661f9d42931036f44 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -350,7 +350,7 @@
             if self.draw_ids:
                 visible_gids = visible.nonzero()[0]
                 ids = [g.id for g in plot.data._grids
-                       if na.any(g.child_mask) and g.id in visible_gids]
+                       if len(g.Children)==0 and g.id in visible_gids]
                 for gid in ids:
                     plot._axes.text(left_edge_x[gid] + (2 * (xx1 - xx0) / xpix),
                                     left_edge_y[gid] + (2 * (yy1 - yy0) / ypix),



https://bitbucket.org/yt_analysis/yt/changeset/5d3a357b5897/
changeset:   5d3a357b5897
branch:      yt
user:        xarthisius
date:        2012-08-31 20:37:30
summary:     Use explicit loop over visible grids, with additional if statement that checks whether grid has overlapping regions
affected #:  1 file

diff -r 8a7c75b0a9c75976bc58bf2661f9d42931036f44 -r 5d3a357b589757d8f21c80abfc2f29dded9874b5 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -348,13 +348,13 @@
             plot._axes.hold(True)
             plot._axes.add_collection(grid_collection)
             if self.draw_ids:
-                visible_gids = visible.nonzero()[0]
-                ids = [g.id for g in plot.data._grids
-                       if len(g.Children)==0 and g.id in visible_gids]
-                for gid in ids:
-                    plot._axes.text(left_edge_x[gid] + (2 * (xx1 - xx0) / xpix),
-                                    left_edge_y[gid] + (2 * (yy1 - yy0) / ypix),
-                                    gid, clip_on=True)
+                for i, g in enumerate(plot.data._grids[visible]):
+                    if na.any(g.child_mask):
+                        gid = na.where(visible)[0][i]
+                        plot._axes.text(
+                                left_edge_x[gid] + (2 * (xx1 - xx0) / xpix),
+                                left_edge_y[gid] + (2 * (yy1 - yy0) / ypix),
+                                g.id, clip_on=True)
             plot._axes.hold(False)
 
 class StreamlineCallback(PlotCallback):



https://bitbucket.org/yt_analysis/yt/changeset/80ff2fb3b5eb/
changeset:   80ff2fb3b5eb
branch:      yt
user:        ngoldbaum
date:        2012-09-02 23:57:15
summary:     Merged in xarthisius/yt (pull request #257)
affected #:  1 file

diff -r 4561e3ff9d02043ae20e66fc2623c82b69f5ef42 -r 80ff2fb3b5eb96f600df3da184d908b6ed4d81eb yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -348,9 +348,13 @@
             plot._axes.hold(True)
             plot._axes.add_collection(grid_collection)
             if self.draw_ids:
-                ids = [g.id for g in plot.data._grids]
-                for n in visible.nonzero()[0]:
-                    plot._axes.text(left_edge_x[n]+(2*(xx1-xx0)/xpix),left_edge_y[n]+(2*(yy1-yy0)/ypix),ids[n],clip_on=True)
+                for i, g in enumerate(plot.data._grids[visible]):
+                    if na.any(g.child_mask):
+                        gid = na.where(visible)[0][i]
+                        plot._axes.text(
+                                left_edge_x[gid] + (2 * (xx1 - xx0) / xpix),
+                                left_edge_y[gid] + (2 * (yy1 - yy0) / ypix),
+                                g.id, clip_on=True)
             plot._axes.hold(False)
 
 class StreamlineCallback(PlotCallback):

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