[Yt-svn] commit/yt: 3 new changesets

Bitbucket commits-noreply at bitbucket.org
Tue Apr 5 05:56:33 PDT 2011


3 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/bfc4033061fb/
changeset:   r4075:bfc4033061fb
branch:      yt
user:        MatthewTurk
date:        2011-04-05 14:42:01
summary:     Fixing some issues with projections, made fields a bit nicer
affected #:  2 files (95 bytes)

--- a/yt/gui/reason/extdirect_repl.py	Mon Apr 04 15:27:57 2011 -0600
+++ b/yt/gui/reason/extdirect_repl.py	Tue Apr 05 08:42:01 2011 -0400
@@ -221,11 +221,12 @@
     @append_payloads
     def create_proj(self, pfname, axis, field, weight):
         if weight == "None": weight = None
+        else: weight = "'%s'" % (weight)
         funccall = """
         _tpf = %(pfname)s
         _taxis = %(axis)s
         _tfield = "%(field)s"
-        _tweight = "%(weight)s"
+        _tweight = %(weight)s
         _tsl = _tpf.h.proj(_taxis,_tfield, weight_field=_tweight)
         _txax, _tyax = x_dict[_taxis], y_dict[_taxis]
         DLE, DRE = _tpf.domain_left_edge, _tpf.domain_right_edge
@@ -287,7 +288,8 @@
         for fn, pf in sorted(_cached_pfs.items()):
             objs = []
             pf_varname = "_cached_pfs['%s']" % (fn)
-            fields = pf.h.field_list + pf.h.derived_field_list
+            fields = set(pf.h.field_list + pf.h.derived_field_list)
+            fields = list(fields)
             fields.sort()
             for i,obj in enumerate(pf.h.objects):
                 try:


--- a/yt/gui/reason/html/js/functions.js	Mon Apr 04 15:27:57 2011 -0600
+++ b/yt/gui/reason/html/js/functions.js	Tue Apr 05 08:42:01 2011 -0400
@@ -268,7 +268,7 @@
                 xtype:'combo',
                 fieldLabel: 'Weight Field',
                 id: 'weightField',
-                store:node.attributes.objdata.field_list,
+                store:['None'].concat(node.attributes.objdata.field_list),
                 width: 230,
                 allowBlank:false,
             }],


http://bitbucket.org/yt_analysis/yt/changeset/d838a843eb8e/
changeset:   r4076:d838a843eb8e
branch:      yt
user:        MatthewTurk
date:        2011-04-05 14:55:19
summary:     Fixing projections to not output a supplemental png_string by disabling the
initial call to _setup_plots.  Also fixing png_string displays in the same way
as in the heartbeat branch.
affected #:  3 files (96 bytes)

--- a/yt/gui/reason/extdirect_repl.py	Tue Apr 05 08:42:01 2011 -0400
+++ b/yt/gui/reason/extdirect_repl.py	Tue Apr 05 08:55:19 2011 -0400
@@ -231,7 +231,7 @@
         _txax, _tyax = x_dict[_taxis], y_dict[_taxis]
         DLE, DRE = _tpf.domain_left_edge, _tpf.domain_right_edge
         from yt.visualization.plot_window import PWViewerExtJS
-        _tpw = PWViewerExtJS(_tsl, (DLE[_txax], DRE[_txax], DLE[_tyax], DRE[_tyax]))
+        _tpw = PWViewerExtJS(_tsl, (DLE[_txax], DRE[_txax], DLE[_tyax], DRE[_tyax]), setup = False)
         _tpw._current_field = _tfield
         _tpw.set_log(_tfield, True)
         add_widget('_tpw')
@@ -255,7 +255,7 @@
         _txax, _tyax = x_dict[_taxis], y_dict[_taxis]
         DLE, DRE = _tpf.domain_left_edge, _tpf.domain_right_edge
         from yt.visualization.plot_window import PWViewerExtJS
-        _tpw = PWViewerExtJS(_tsl, (DLE[_txax], DRE[_txax], DLE[_tyax], DRE[_tyax]))
+        _tpw = PWViewerExtJS(_tsl, (DLE[_txax], DRE[_txax], DLE[_tyax], DRE[_tyax]), setup = False)
         _tpw._current_field = _tfield
         _tpw.set_log(_tfield, True)
         add_widget('_tpw')


--- a/yt/gui/reason/html/js/functions.js	Tue Apr 05 08:42:01 2011 -0400
+++ b/yt/gui/reason/html/js/functions.js	Tue Apr 05 08:55:19 2011 -0400
@@ -48,7 +48,7 @@
                 cell.body.dom.scrollHeight - 20;
             }
         } else if (payload['type'] == 'png_string') {
-            new_cell.add(new Ext.Panel({
+            OutputContainer.add(new Ext.Panel({
                 autoEl:{
                     tag:'img', 
                     width:'25%',
@@ -57,7 +57,7 @@
                     onClick: "display_image('payload_image_" + number_images + "');"
 		        }
             }));
-	        new_cell.doLayout();
+	        OutputContainer.doLayout();
 	        number_images++;
         } else if (payload['type'] == 'cell_contents') {
 	        var input_line = repl_input.get("input_line");


--- a/yt/visualization/plot_window.py	Tue Apr 05 08:42:01 2011 -0400
+++ b/yt/visualization/plot_window.py	Tue Apr 05 08:55:19 2011 -0400
@@ -207,6 +207,7 @@
 
     """
     def __init__(self, *args,**kwargs):
+        setup = kwargs.pop("setup", True)
         PlotWindow.__init__(self, *args,**kwargs)
         self._field_transform = {}
         for field in self._frb.data.keys():
@@ -215,7 +216,7 @@
             else:
                 self._field_transform[field] = lambda x: x
 
-        self._setup_plots()
+        if setup: self._setup_plots()
 
     def set_log(self,field,log):
         """set a field to log or linear.


http://bitbucket.org/yt_analysis/yt/changeset/c5881d44e276/
changeset:   r4077:c5881d44e276
branch:      yt
user:        MatthewTurk
date:        2011-04-05 14:55:45
summary:     Merging
affected #:  2 files (746 bytes)

--- a/yt/data_objects/derived_quantities.py	Tue Apr 05 08:55:19 2011 -0400
+++ b/yt/data_objects/derived_quantities.py	Tue Apr 05 08:55:45 2011 -0400
@@ -394,17 +394,6 @@
         dxes = dxes[lsort]
         dyes = dyes[lsort]
         dzes = dzes[lsort]
-        # This step adds massless cells for all the levels we need in order
-        # to fully populate all the parent-child cells needed.
-        for L in range(min(data.pf.h.max_level+1, na.amax(levels)+1)):
-            ActiveDimensions = cover_ActiveDimensions * 2**L
-            i, j, k = na.indices(ActiveDimensions)
-            i = i.flatten()
-            j = j.flatten()
-            k = k.flatten()
-            octree.add_array_to_tree(L, i, j, k,
-                na.array([na.zeros_like(i)], order='F', dtype='float64'),
-                na.zeros_like(i).astype('float64'))
         # Now we add actual data to the octree.
         for L, dx, dy, dz in zip(levels, dxes, dyes, dzes):
             mylog.info("Adding data to Octree for level %d" % L)


--- a/yt/utilities/_amr_utils/Octree.pyx	Tue Apr 05 08:55:19 2011 -0400
+++ b/yt/utilities/_amr_utils/Octree.pyx	Tue Apr 05 08:55:45 2011 -0400
@@ -80,14 +80,14 @@
                 self.children[i][j][k] = OTN_initialize(
                             npos,
                             self.nvals, self.val, self.weight_val,
-                            self.level + 1, self)
+                            self.level + 1, self, incremental)
     if incremental: return
     for i in range(self.nvals): self.val[i] = 0.0
     self.weight_val = 0.0
 
 cdef OctreeNode *OTN_initialize(np.int64_t pos[3], int nvals,
                         np.float64_t *val, np.float64_t weight_val,
-                        int level, OctreeNode *parent):
+                        int level, OctreeNode *parent, int incremental = 0):
     cdef OctreeNode *node
     cdef int i, j, k
     node = <OctreeNode *> malloc(sizeof(OctreeNode))
@@ -101,9 +101,14 @@
     node.max_level = 0
     node.val = <np.float64_t *> malloc(
                 nvals * sizeof(np.float64_t))
-    for i in range(nvals):
-        node.val[i] = val[i]
-    node.weight_val = weight_val
+    if incremental:
+        for i in range(nvals):
+            node.val[i] = 0.
+        node.weight_val = 0.
+    else:
+        for i in range(nvals):
+            node.val[i] = val[i]
+        node.weight_val = weight_val
     for i in range(2):
         for j in range(2):
             for k in range(2):

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