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

Bitbucket commits-noreply at bitbucket.org
Fri Apr 22 16:03:54 PDT 2011


2 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/cda1612ad266/
changeset:   r4188:cda1612ad266
branch:      yt
user:        MatthewTurk
date:        2011-04-23 00:11:29
summary:     Minor changes to a couple things, just for stylistic purposes.
affected #:  4 files (486 bytes)

--- a/yt/gui/reason/html/index.html	Fri Apr 22 15:49:43 2011 -0400
+++ b/yt/gui/reason/html/index.html	Fri Apr 22 18:11:29 2011 -0400
@@ -72,6 +72,11 @@
     }
     </style>
 
+    <!-- FONTS -->
+    <!-- These will get pulled from Google, but Google might not be accessible.
+         In that case, it will default to whatever is in the family. -->
+    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata">
+
     <!-- LIBS --><script type="text/javascript" src="resources/adapter/ext/ext-base.js"></script><script type="text/javascript" src="resources/ext-all.js"></script>


--- a/yt/gui/reason/html/js/reason.js	Fri Apr 22 15:49:43 2011 -0400
+++ b/yt/gui/reason/html/js/reason.js	Fri Apr 22 18:11:29 2011 -0400
@@ -281,7 +281,8 @@
         function(b,e){ repl_input.get("input_line").focus(); });
         Ext.state.Manager.set("reason_welcomed", true);
     } else { 
-        repl_input.get("input_line").focus(); }
+        repl_input.get("input_line").focus();
+    }
 
     /* Set up the heartbeat */
     var num = 0;


--- a/yt/gui/reason/html/js/widget_plotwindow.js	Fri Apr 22 15:49:43 2011 -0400
+++ b/yt/gui/reason/html/js/widget_plotwindow.js	Fri Apr 22 18:11:29 2011 -0400
@@ -283,6 +283,8 @@
                     x: 10,
                     y: 285,
                     width: 80,
+                    tooltip: "Upload the current image to " +
+                             "<a href='http://imgur.com'>imgur.com</a>",
                     handler: function(b,e) {
                         img_data = image_dom.src;
                         yt_rpc.ExtDirectREPL.upload_image(
@@ -308,7 +310,7 @@
                     id: 'metadata_' + python_varname,
                     width: 300,
                     height: 200,
-                    style: {fontFamily: 'monospace'},
+                    style: {fontFamily: '"Inconsolata", monospace'},
                     x: 510, y: 10,
                 }
             ]


--- a/yt/visualization/plot_window.py	Fri Apr 22 15:49:43 2011 -0400
+++ b/yt/visualization/plot_window.py	Fri Apr 22 18:11:29 2011 -0400
@@ -302,10 +302,11 @@
             write_image(self._frb[field],nm)
 
 _metadata_template = """
-                    %(pf)s
-X Field of View     %(x_width)0.3f %(unit)s
-Y Field of View     %(y_width)0.3f %(unit)s
-Extrema             %(mi)0.3e - %(ma)0.3e
+%(pf)s
+
+Field of View:  %(x_width)0.3f %(unit)s
+Minimum Value:  %(mi)0.3e
+Maximum Value:  %(ma)0.3e
 """
 
 class PWViewerExtJS(PWViewer):


http://bitbucket.org/yt_analysis/yt/changeset/a00bde30a418/
changeset:   r4189:a00bde30a418
branch:      yt
user:        MatthewTurk
date:        2011-04-23 01:03:30
summary:     Adding field units and moving the plot window metadata around ever-so-slightly.
Adding a future spot for the plot editor component.
affected #:  3 files (1.4 KB)

--- a/yt/gui/reason/extdirect_repl.py	Fri Apr 22 18:11:29 2011 -0400
+++ b/yt/gui/reason/extdirect_repl.py	Fri Apr 22 19:03:30 2011 -0400
@@ -356,7 +356,8 @@
         _tfield_list = list(set(_tpf.h.field_list + _tpf.h.derived_field_list))
         _tfield_list.sort()
         _twidget_data = {'fields': _tfield_list,
-                         'initial_field': _tfield}
+                         'initial_field': _tfield,
+                         'title': "%%s Slice" %% (_tpf)}
         """ % dict(pfname = pfname,
                    axis = inv_axis_names[axis],
                    weight = weight,
@@ -393,7 +394,8 @@
         _tfield_list = list(set(_tpf.h.field_list + _tpf.h.derived_field_list))
         _tfield_list.sort()
         _twidget_data = {'fields': _tfield_list,
-                         'initial_field': _tfield}
+                         'initial_field': _tfield,
+                         'title': "%%s Slice" %% (_tpf)}
         """ % dict(pfname = pfname,
                    center_string = center_string,
                    axis = inv_axis_names[axis],


--- a/yt/gui/reason/html/js/widget_plotwindow.js	Fri Apr 22 18:11:29 2011 -0400
+++ b/yt/gui/reason/html/js/widget_plotwindow.js	Fri Apr 22 19:03:30 2011 -0400
@@ -53,7 +53,7 @@
         {
             xtype: 'panel',
             id: "pw_" + this.id,
-            title: "Plot Window",
+            title: widget_data['title'],
             iconCls: 'graph',
             autoScroll: true,
             layout:'absolute',
@@ -305,13 +305,30 @@
                         }); 
                     }
                 },{
-                    xtype: 'textarea',
-                    readOnly: true,
-                    id: 'metadata_' + python_varname,
+                    xtype: 'panel',
+                    layout: 'vbox',
+                    id: 'rhs_panel_' + python_varname,
                     width: 300,
-                    height: 200,
-                    style: {fontFamily: '"Inconsolata", monospace'},
+                    height: 460,
                     x: 510, y: 10,
+                    layoutConfig: {
+                        align: 'stretch',
+                        pack: 'start',
+                    },
+                    items: [
+                        {
+                          xtype: 'panel',
+                          title: 'Plot MetaData',
+                          id: 'metadata_' + python_varname,
+                          style: {fontFamily: '"Inconsolata", monospace'},
+                          html: 'Welcome to the Plot Window.',
+                          height: 200,
+                        }, {
+                          xtype: 'panel',
+                          title: 'Plot Editor',
+                          id: 'plot_edit',
+                          flex: 1,
+                        }]
                 }
             ]
         }
@@ -324,7 +341,7 @@
     this.panel.doLayout();
     this.panel.show();
     this.image_panel = this.panel.get("image_panel_"+python_varname);
-    this.metadata_panel = this.panel.get("metadata_" + python_varname);
+    this.metadata_panel = this.panel.get("rhs_panel_" + python_varname).get("metadata_" + python_varname);
     this.zoom_scroll = this.panel.get("slider_" + python_varname);
     var image_dom = this.image_panel.el.dom;
     var control_panel = this.panel;
@@ -333,7 +350,8 @@
     this.accept_results = function(payload) {
         this.image_panel.el.dom.src = "data:image/png;base64," + payload['image_data'];
         this.zoom_scroll.setValue(0, payload['zoom'], true);
-        this.metadata_panel.setValue(payload['metadata_string']);
+        examine = this.metadata_panel;
+        this.metadata_panel.update(payload['metadata_string']);
         metadata_string = payload['metadata_string'];
     }
 


--- a/yt/visualization/plot_window.py	Fri Apr 22 18:11:29 2011 -0400
+++ b/yt/visualization/plot_window.py	Fri Apr 22 19:03:30 2011 -0400
@@ -302,11 +302,11 @@
             write_image(self._frb[field],nm)
 
 _metadata_template = """
-%(pf)s
-
-Field of View:  %(x_width)0.3f %(unit)s
-Minimum Value:  %(mi)0.3e
-Maximum Value:  %(ma)0.3e
+%(pf)s<br>
+<br>
+Field of View:  %(x_width)0.3f %(unit)s<br>
+Minimum Value:  %(mi)0.3e %(units)s<br>
+Maximum Value:  %(ma)0.3e %(units)s
 """
 
 class PWViewerExtJS(PWViewer):
@@ -364,11 +364,12 @@
         x_width = self.xlim[1] - self.xlim[0]
         y_width = self.ylim[1] - self.ylim[0]
         unit = get_smallest_appropriate_unit(x_width, self._frb.pf)
+        units = self.get_field_units(field)
         md = _metadata_template % dict(
                 pf = self._frb.pf,
                 x_width = x_width*self._frb.pf[unit],
                 y_width = y_width*self._frb.pf[unit],
-                unit = unit, mi = mi, ma = ma)
+                unit = unit, units = units, mi = mi, ma = ma)
         return md
 
     def image_recenter(self, img_x, img_y, img_size_x, img_size_y):
@@ -388,6 +389,19 @@
         else:
             self._field_transform[field] = lambda x: x
 
+    def get_field_units(self, field, strip_mathml = True):
+        ds = self._frb.data_source
+        pf = self._frb.pf
+        if ds._type_name == "slice":
+            units = pf.field_info[field].get_units()
+        elif ds._type_name == "proj":
+            units = pf.field_info[field].get_projected_units()
+        else:
+            units = ""
+        if strip_mathml:
+            units = units.replace(r"\rm{", "").replace("}","")
+        return units
+
 
 class YtPlot(object):
     """A base class for all yt plots. It should abstract the actual

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