[Yt-svn] yt-commit r1135 - in trunk: . tests yt/lagos yt/raven

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Thu Jan 22 09:20:01 PST 2009


Author: mturk
Date: Thu Jan 22 09:20:00 2009
New Revision: 1135
URL: http://yt.spacepope.org/changeset/1135

Log:
Pulled out a print statement from one of the tests, changed the .hierarchy to
be a property of the profile, and removed the manual setting of pf and
hierarchy in PlotCollection.  You can now pickle plot_object.data where
plot_object is a profile plot or phase plot


Modified:
   trunk/   (props changed)
   trunk/tests/test_lagos.py
   trunk/yt/lagos/Profiles.py
   trunk/yt/raven/PlotCollection.py

Modified: trunk/tests/test_lagos.py
==============================================================================
--- trunk/tests/test_lagos.py	(original)
+++ trunk/tests/test_lagos.py	Thu Jan 22 09:20:00 2009
@@ -172,7 +172,6 @@
         ma = self.data["Density"].max() * 0.99
         cons, contours = self.data.extract_connected_sets(
             "Density", 2, mi, ma)
-        print cons
         self.assertEqual(len(contours), 2) # number of contour levels
         self.assertEqual(len(contours[0]), 2)
         self.assertEqual(len(contours[1]), 1)

Modified: trunk/yt/lagos/Profiles.py
==============================================================================
--- trunk/yt/lagos/Profiles.py	(original)
+++ trunk/yt/lagos/Profiles.py	Thu Jan 22 09:20:00 2009
@@ -56,6 +56,10 @@
         self._pdata = {}
         self._lazy_reader = lazy_reader
 
+    @property
+    def hierarchy(self):
+        return self.pf.hierarchy
+
     def _get_dependencies(self, fields):
         return ParallelAnalysisInterface._get_dependencies(
                     self, fields + self._get_bin_fields())

Modified: trunk/yt/raven/PlotCollection.py
==============================================================================
--- trunk/yt/raven/PlotCollection.py	(original)
+++ trunk/yt/raven/PlotCollection.py	Thu Jan 22 09:20:00 2009
@@ -301,8 +301,6 @@
         if len(fields) > 1:
             profile.add_fields(fields[1], weight=weight, accumulation=accumulation)
         # These next two lines are painful.
-        profile.pf = self.pf
-        profile.hierarchy = self.pf.hierarchy
         if id is None: id = self._get_new_id()
         p = self._add_plot(PlotTypes.Profile1DPlot(profile, fields, id,
                                                    axes=axes, figure=figure))
@@ -353,8 +351,6 @@
                                      y_bins, fields[1], y_min, y_max, y_log,
                                      lazy_reader)
         # These next two lines are painful.
-        profile.pf = self.pf
-        profile.hierarchy = self.pf.hierarchy
         if id is None: id = self._get_new_id()
         p = self._add_plot(PlotTypes.PhasePlot(profile, fields, 
                                                id, cmap=cmap,



More information about the yt-svn mailing list