[Yt-svn] yt-commit r803 - in trunk: tests yt/lagos yt/reason

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Fri Sep 26 16:17:31 PDT 2008


Author: mturk
Date: Fri Sep 26 16:17:31 2008
New Revision: 803
URL: http://yt.spacepope.org/changeset/803

Log:
Fixed some problems with reason and MPL 0.98.3 and a couple with user-defined
default cmaps.

Fixed some tests that were breaking or were obsolete.

Got rid of the last indication of a scipy import.



Modified:
   trunk/tests/test_lagos.py
   trunk/yt/lagos/DerivedFields.py
   trunk/yt/reason/App.py
   trunk/yt/reason/Notebook.py

Modified: trunk/tests/test_lagos.py
==============================================================================
--- trunk/tests/test_lagos.py	(original)
+++ trunk/tests/test_lagos.py	Fri Sep 26 16:17:31 2008
@@ -231,13 +231,6 @@
             self.assertFalse(na.any(na.isnan(cg["Density"])))
             self.assertFalse(na.any(cg["Density"]==-999))
 
-    def testWrongDims(self):
-        self.failUnlessRaises(ValueError,
-                self.hierarchy.smoothed_covering_grid,
-                level=2, left_edge=[0.25, 0.25, 0.25],
-                right_edge=[0.75, 0.75, 0.75],
-                dims=[123, 124, 125])
-
     def testAddField(self):
         DIMS = 64
         i = 5
@@ -342,7 +335,7 @@
 class TestCuttingPlane(DataTypeTestingBase, LagosTestingBase, unittest.TestCase):
     def setUp(self):
         DataTypeTestingBase.setUp(self)
-        self.data = self.hierarchy.cutting([0.1,0.3,0.4], [0.5,0.5,0.5])
+        self.data = self.hierarchy.cutting([0.1,0.3,0.4], [0.5,0.5,0.5], ["Density"])
     def testAxisVectors(self):
         x_v = self.data._x_vec
         y_v = self.data._y_vec

Modified: trunk/yt/lagos/DerivedFields.py
==============================================================================
--- trunk/yt/lagos/DerivedFields.py	(original)
+++ trunk/yt/lagos/DerivedFields.py	Fri Sep 26 16:17:31 2008
@@ -638,26 +638,6 @@
     return conv
 add_field("SZY", convert_function=_convertSZY)
 
-def __gauss_kern(size):
-    """ Returns a normalized 2D gauss kernel array for convolutions """
-    size = int(size)
-    x, y, z = na.mgrid[-size:size+1, -size:size+1, -size:size+1]
-    g = na.exp(-(x**2/float(size)+y**2/float(size)+z**2/float(size)))
-    return g / g.sum()
-
-def __blur_image(im, n):
-    """ blurs the image by convolving with a gaussian kernel of typical
-        size n. The optional keyword argument ny allows for a different
-        size in the y direction.
-    """
-    g = __gauss_kern(n)
-    improc = scipy.signal.convolve(im,g, mode='same')
-    return(improc)
-
-def _SmoothedDensity(field, data):
-    return __blur_image(data["Density"], 1)
-add_field("SmoothedDensity", validators=[ValidateSpatial(2)])
-
 def _AveragedDensity(field, data):
     nx, ny, nz = data["Density"].shape
     new_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')

Modified: trunk/yt/reason/App.py
==============================================================================
--- trunk/yt/reason/App.py	(original)
+++ trunk/yt/reason/App.py	Fri Sep 26 16:17:31 2008
@@ -156,6 +156,8 @@
         self.data_tree.Expand(self.data_root)
 
         self.data_tree.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
+        self.data_tree.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
+        self.data_tree.Bind(wx.EVT_LEFT_DCLICK, self.OnRightDown)
         self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded, self.data_tree)
 
         self.__setup_fido_tree()

Modified: trunk/yt/reason/Notebook.py
==============================================================================
--- trunk/yt/reason/Notebook.py	(original)
+++ trunk/yt/reason/Notebook.py	Fri Sep 26 16:17:31 2008
@@ -298,7 +298,10 @@
             ccmap_name = self.plot.colorbar.cmap.name
         except AttributeError:
             ccmap_name = "jet"
-        self.cmapmenu.FindItemById(self.cmapmenu.FindItem(ccmap_name)).Check(True)
+        try:
+            self.cmapmenu.FindItemById(self.cmapmenu.FindItem(ccmap_name)).Check(True)
+        except AttributeError:
+            pass
 
     def makePlot(self):
         pass
@@ -502,7 +505,7 @@
         #xp, yp = self.figure.axes[0].transData.inverse_xy_tup((xp,yp))
         dx = (self.plot.xlim[1] - self.plot.xlim[0])/self.plot.pix[0]
         dy = (self.plot.ylim[1] - self.plot.ylim[0])/self.plot.pix[1]
-        l, b, width, height = self.figure.axes[0].bbox.get_bounds()
+        l, b, width, height = raven.PlotTypes._get_bounds(self.figure.axes[0].bbox)
         x = self.plot.xlim[0] + (dx * (xp-l))
         y = self.plot.ylim[1] - (dy * (yp-b))
         return x, y



More information about the yt-svn mailing list