[Yt-svn] yt-commit r1673 - trunk/yt/lagos

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Tue Mar 23 22:19:11 PDT 2010


Author: mturk
Date: Tue Mar 23 22:19:10 2010
New Revision: 1673
URL: http://yt.enzotools.org/changeset/1673

Log:
This is kind of a hack, but it fixes pickling of 2D data objects -- useful for
pushing and pulling objects across the network in IPython.  Most of the 2D data
objects assume that self.field is a string, but here the field variable was
bound to the local namespace "field", which was uninitialized in the local
namespace.  So, it was usually set to something like PreShock_Density, when it
should be set to the variable fields.  But to match up, we ensure it's a list
and take the first element.



Modified:
   trunk/yt/lagos/BaseDataTypes.py

Modified: trunk/yt/lagos/BaseDataTypes.py
==============================================================================
--- trunk/yt/lagos/BaseDataTypes.py	(original)
+++ trunk/yt/lagos/BaseDataTypes.py	Tue Mar 23 22:19:10 2010
@@ -556,7 +556,7 @@
         """
         self.axis = axis
         AMRData.__init__(self, pf, fields, **kwargs)
-        self.field = field
+        self.field = ensure_list(fields)[0]
         self.set_field_parameter("axis",axis)
         
     def _convert_field_name(self, field):



More information about the yt-svn mailing list