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

Bitbucket commits-noreply at bitbucket.org
Sun Jan 13 17:17:35 PST 2013


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/a3b515ca0527/
changeset:   a3b515ca0527
branch:      yt
user:        Andrew Myers
date:        2013-01-14 01:55:04
summary:     adding an optional field_parameters keyword argument to SlicePlots and ProjectionPlots to allow the visualization of fields that require extra information
affected #:  1 file

diff -r badabbdbcf91d76bacfb4ed8f7edb876556416e0 -r a3b515ca052758a45d952925fd64c1772e846cc4 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -976,7 +976,7 @@
     _frb_generator = FixedResolutionBuffer
 
     def __init__(self, pf, axis, fields, center='c', width=None, axes_unit=None,
-                 origin='center-window', fontsize=15):
+                 origin='center-window', fontsize=15, field_parameters={}):
         r"""Creates a slice plot from a parameter file
         
         Given a pf object, an axis to slice along, and a field name
@@ -1054,7 +1054,7 @@
         (bounds, center, units) = GetWindowParameters(axis, center, width, pf)
         if axes_unit is None and units != ('1', '1'):
             axes_unit = units
-        slc = pf.h.slice(axis, center[axis], center=center, fields=fields)
+        slc = pf.h.slice(axis, center[axis], center=center, fields=fields, **field_parameters)
         PWViewerMPL.__init__(self, slc, bounds, origin=origin)
         self.set_axes_unit(axes_unit)
 
@@ -1063,7 +1063,8 @@
     _frb_generator = FixedResolutionBuffer
 
     def __init__(self, pf, axis, fields, center='c', width=None, axes_unit=None,
-                 weight_field=None, max_level=None, origin='center-window', fontsize=15):
+                 weight_field=None, max_level=None, origin='center-window', fontsize=15, 
+                 field_parameters={}):
         r"""Creates a projection plot from a parameter file
         
         Given a pf object, an axis to project along, and a field name
@@ -1144,7 +1145,8 @@
         (bounds, center, units) = GetWindowParameters(axis, center, width, pf)
         if axes_unit is None  and units != ('1', '1'):
             axes_unit = units
-        proj = pf.h.proj(axis,fields,weight_field=weight_field,max_level=max_level,center=center)
+        proj = pf.h.proj(axis,fields,weight_field=weight_field,max_level=max_level,
+                         center=center, **field_parameters)
         PWViewerMPL.__init__(self,proj,bounds,origin=origin)
         self.set_axes_unit(axes_unit)
 


https://bitbucket.org/yt_analysis/yt/commits/568ea7a65593/
changeset:   568ea7a65593
branch:      yt
user:        Andrew Myers
date:        2013-01-14 02:02:20
summary:     adding to the docstrings
affected #:  1 file

diff -r a3b515ca052758a45d952925fd64c1772e846cc4 -r 568ea7a65593e077a70a6f570c92c317a4ab2b82 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -1035,6 +1035,8 @@
              the center of the plot window.
         fontsize : integer
              The size of the fonts for the axis, colorbar, and tick labels.
+        field_parameters : dictionary
+             A dictionary of field parameters than can be accessed by derived fields.
              
         Examples
         --------
@@ -1127,7 +1129,9 @@
              The maximum level to project to.
         fontsize : integer
              The size of the fonts for the axis, colorbar, and tick labels.
-        
+        field_parameters : dictionary
+             A dictionary of field parameters than can be accessed by derived fields.
+
         Examples
         --------
         


https://bitbucket.org/yt_analysis/yt/commits/bf5f6f75516f/
changeset:   bf5f6f75516f
branch:      yt
user:        Andrew Myers
date:        2013-01-14 02:14:58
summary:     removing mutable objects from function calls
affected #:  1 file

diff -r 568ea7a65593e077a70a6f570c92c317a4ab2b82 -r bf5f6f75516f41ac36c824c62df8639a684ffc1a yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -976,7 +976,7 @@
     _frb_generator = FixedResolutionBuffer
 
     def __init__(self, pf, axis, fields, center='c', width=None, axes_unit=None,
-                 origin='center-window', fontsize=15, field_parameters={}):
+                 origin='center-window', fontsize=15, field_parameters=None):
         r"""Creates a slice plot from a parameter file
         
         Given a pf object, an axis to slice along, and a field name
@@ -1056,6 +1056,7 @@
         (bounds, center, units) = GetWindowParameters(axis, center, width, pf)
         if axes_unit is None and units != ('1', '1'):
             axes_unit = units
+        if field_parameters is None: field_parameters = {}
         slc = pf.h.slice(axis, center[axis], center=center, fields=fields, **field_parameters)
         PWViewerMPL.__init__(self, slc, bounds, origin=origin)
         self.set_axes_unit(axes_unit)
@@ -1066,7 +1067,7 @@
 
     def __init__(self, pf, axis, fields, center='c', width=None, axes_unit=None,
                  weight_field=None, max_level=None, origin='center-window', fontsize=15, 
-                 field_parameters={}):
+                 field_parameters=None):
         r"""Creates a projection plot from a parameter file
         
         Given a pf object, an axis to project along, and a field name
@@ -1149,6 +1150,7 @@
         (bounds, center, units) = GetWindowParameters(axis, center, width, pf)
         if axes_unit is None  and units != ('1', '1'):
             axes_unit = units
+        if field_parameters is None: field_parameters = {}
         proj = pf.h.proj(axis,fields,weight_field=weight_field,max_level=max_level,
                          center=center, **field_parameters)
         PWViewerMPL.__init__(self,proj,bounds,origin=origin)

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