[Yt-svn] yt-commit r860 - in trunk/yt: . raven

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Fri Oct 31 21:37:56 PDT 2008


Author: mturk
Date: Fri Oct 31 21:37:56 2008
New Revision: 860
URL: http://yt.spacepope.org/changeset/860

Log:
Two minor things.  1. LabelCallback, 2. raise an IOError if the pf doesn't
exist in the recipes file.



Modified:
   trunk/yt/raven/Callbacks.py
   trunk/yt/recipes.py

Modified: trunk/yt/raven/Callbacks.py
==============================================================================
--- trunk/yt/raven/Callbacks.py	(original)
+++ trunk/yt/raven/Callbacks.py	Fri Oct 31 21:37:56 2008
@@ -242,6 +242,18 @@
         plot._axes.add_collection(grid_collection)
         plot._axes.hold(False)
 
+class LabelCallback(PlotCallback):
+    def __init__(self, label):
+        PlotCallback.__init__(self)
+        self.label = label
+
+    def __call__(self, plot):
+        plot._figure.subplots_adjust(hspace=0, wspace=0,
+                                     bottom=0.1, top=0.9,
+                                     left=0.0, right=1.0)
+        plot._axes.set_xlabel(self.label)
+        plot._axes.set_ylabel(self.label)
+
 def get_smallest_appropriate_unit(v, pf):
     max_nu = 1e30
     good_u = None

Modified: trunk/yt/recipes.py
==============================================================================
--- trunk/yt/recipes.py	(original)
+++ trunk/yt/recipes.py	Fri Oct 31 21:37:56 2008
@@ -39,6 +39,8 @@
     elif pf.endswith(".hierarchy"):
         return lagos.EnzoStaticOutput(pf[:-10])
     # JS will have to implement the Orion one
+    else:
+        raise IOError(pf)
 
 __pf_centers = {}
 def _fix_center(pf, center):



More information about the yt-svn mailing list