Revision: 7050
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7050&view=rev
Author:   jdh2358
Date:     2009-04-17 20:40:29 +0000 (Fri, 17 Apr 2009)

Log Message:
-----------
use 0 for default in rec join outer join if no default given

Modified Paths:
--------------
    trunk/matplotlib/doc/sphinxext/gen_gallery.py
    trunk/matplotlib/examples/misc/rec_join_demo.py
    trunk/matplotlib/lib/matplotlib/backend_bases.py
    trunk/matplotlib/lib/matplotlib/mlab.py

Modified: trunk/matplotlib/doc/sphinxext/gen_gallery.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/gen_gallery.py       2009-04-17 20:20:07 UTC 
(rev 7049)
+++ trunk/matplotlib/doc/sphinxext/gen_gallery.py       2009-04-17 20:40:29 UTC 
(rev 7050)
@@ -38,7 +38,7 @@
     print
     print "generating gallery: ",
     data = []
-    for subdir in ('api', 'pylab_examples', 'widgets'):
+    for subdir in ('api', 'pylab_examples', 'widgets', 'mplot3d'):
         origdir = os.path.join('build', rootdir, subdir)
         thumbdir = os.path.join(outdir, rootdir, subdir, 'thumbnails')
         if not os.path.exists(thumbdir):

Modified: trunk/matplotlib/examples/misc/rec_join_demo.py
===================================================================
--- trunk/matplotlib/examples/misc/rec_join_demo.py     2009-04-17 20:20:07 UTC 
(rev 7049)
+++ trunk/matplotlib/examples/misc/rec_join_demo.py     2009-04-17 20:40:29 UTC 
(rev 7050)
@@ -6,8 +6,8 @@
 r.sort()
 r1 = r[-10:]
 
-# Create a new array 
-r2 = np.empty(12, dtype=[('date', '|O4'), ('high', np.float), 
+# Create a new array
+r2 = np.empty(12, dtype=[('date', '|O4'), ('high', np.float),
                             ('marker', np.float)])
 r2 = r2.view(np.recarray)
 r2.date = r.date[-17:-5]
@@ -19,9 +19,9 @@
 print "r2:"
 print mlab.rec2txt(r2)
 
-defaults = {'marker':-1, 'close':np.NaN, 'low':-4444.}
+defaults = {'marker':-1, '_close':np.NaN, 'low':-4444.}
 
 for s in ('inner', 'outer', 'leftouter'):
-    rec = mlab.rec_join(['date', 'high'], r1, r2, 
-            jointype=s, defaults=defaults) 
+    rec = mlab.rec_join(['date', 'high'], r1, r2,
+            jointype=s, defaults=defaults)
     print "\n%sjoin :\n%s" % (s, mlab.rec2txt(rec))

Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py    2009-04-17 20:20:07 UTC 
(rev 7049)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py    2009-04-17 20:40:29 UTC 
(rev 7050)
@@ -1058,7 +1058,7 @@
         under = self.figure.hitlist(ev)
         enter = [a for a in under if a not in self._active]
         leave = [a for a in self._active if a not in under]
-        print "within:"," ".join([str(x) for x in under])
+        #print "within:"," ".join([str(x) for x in under])
         #print "entering:",[str(a) for a in enter]
         #print "leaving:",[str(a) for a in leave]
         # On leave restore the captured colour
@@ -1520,6 +1520,10 @@
         - 'pick_event'
         - 'resize_event'
         - 'scroll_event'
+        - 'figure_enter_event',
+        - 'figure_leave_event',
+        - 'axes_enter_event',
+        - 'axes_leave_event'
 
         For the location events (button and key press/release), if the
         mouse is over the axes, the variable ``event.inaxes`` will be

Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py     2009-04-17 20:20:07 UTC (rev 
7049)
+++ trunk/matplotlib/lib/matplotlib/mlab.py     2009-04-17 20:40:29 UTC (rev 
7050)
@@ -2303,6 +2303,17 @@
 
     newrec = np.empty(common_len + left_len + right_len, dtype=newdtype)
 
+    if defaults is not None:
+        for thiskey in defaults:
+            if thiskey not in newdtype.names:
+                warnings.warn('rec_join defaults key="%s" not in new dtype 
names "%s"'%(
+                    thiskey, newdtype.names))
+
+    for name in newdtype.names:
+        dt = newdtype[name]
+        if dt.kind in ('f', 'i'):
+            newrec[name] = 0
+
     if jointype != 'inner' and defaults is not None: # fill in the defaults 
enmasse
         newrec_fields = newrec.dtype.fields.keys()
         for k, v in defaults.items():


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to