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

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Thu Apr 16 22:42:12 PDT 2009


Author: mturk
Date: Thu Apr 16 22:42:11 2009
New Revision: 1255
URL: http://yt.spacepope.org/changeset/1255

Log:
Added an explicit width setting to the ParticlePlot and a deprecation
mechanism.



Modified:
   trunk/yt/funcs.py
   trunk/yt/lagos/HierarchyType.py
   trunk/yt/raven/PlotTypes.py

Modified: trunk/yt/funcs.py
==============================================================================
--- trunk/yt/funcs.py	(original)
+++ trunk/yt/funcs.py	Thu Apr 16 22:42:11 2009
@@ -24,6 +24,7 @@
 """
 
 import time, types, signal, inspect, traceback, sys, pdb, rpdb
+import warnings
 import progressbar as pb
 from math import floor, ceil
 
@@ -218,3 +219,11 @@
         return func(*args,**kwargs)
     if ytcfg.getint("yt","__parallel_rank") > 0: return
     return func(*args, **kwargs)
+
+def deprecate(func):
+    @wraps(func)
+    def run_func(*args, **kwargs):
+        warnings.warn("%s has been deprecated and may be removed without notice!" \
+                % func.func_name, DeprecationWarning, stacklevel=2)
+        func(*args, **kwargs)
+    return run_func

Modified: trunk/yt/lagos/HierarchyType.py
==============================================================================
--- trunk/yt/lagos/HierarchyType.py	(original)
+++ trunk/yt/lagos/HierarchyType.py	Thu Apr 16 22:42:11 2009
@@ -297,7 +297,7 @@
         """
         mg, mc, mv, pos = self.find_max_cell_location(field, finestLevels)
         return mv, pos
-    findMax = find_max
+    findMax = deprecate(find_max)
 
     def find_max_cell_location(self, field, finestLevels = True):
         if finestLevels:

Modified: trunk/yt/raven/PlotTypes.py
==============================================================================
--- trunk/yt/raven/PlotTypes.py	(original)
+++ trunk/yt/raven/PlotTypes.py	Thu Apr 16 22:42:11 2009
@@ -534,6 +534,7 @@
         self.axis_names['Z'] = col
         from Callbacks import ParticleCallback
         self.add_callback(ParticleCallback(axis, width, p_size, col, stride))
+        self.set_width(1,'unitary')
 
     def _redraw_image(self, *args):
         self._axes.clear() # To help out the colorbar



More information about the yt-svn mailing list