On Thu, Jul 29, 2010 at 6:17 PM, Benjamin Root <ben.r...@ou.edu> wrote:

> As a side-note, it looks like various files that have been changed due to
> svnmerge.py are still showing themselves as having their properties
> modified.  Is this ok?

Yes, for some reason some of the files, like axes3d examples, are
always tagged with property changes on svn merges.  It's a nuisance.
but harmless.  In the handling of weights vs x, I notice in some
places we call np.array and others np.asarray.  Shouldn't we be using
asarray in all of these cases, eg

Index: lib/matplotlib/axes.py
===================================================================
--- lib/matplotlib/axes.py      (revision 8606)
+++ lib/matplotlib/axes.py      (working copy)
@@ -7401,11 +7401,13 @@
              **kwargs):
         """
         call signature::
+
+          def hist(x, bins=10, range=None, normed=False, weights=None,
+                 cumulative=False, bottom=None, histtype='bar', align='mid',
+                 orientation='vertical', rwidth=None, log=False,
+                 color=None, label=None,
+                 **kwargs):

-          hist(x, bins=10, range=None, normed=False, cumulative=False,
-               bottom=None, histtype='bar', align='mid',
-               orientation='vertical', rwidth=None, log=False, **kwargs)
-
         Compute and draw the histogram of *x*. The return value is a
         tuple (*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*,
         [*patches0*, *patches1*,...]) if the input contains multiple
@@ -7567,7 +7569,7 @@
                     'this looks transposed (shape is %d x %d)' % x.shape[::-1])
         else:
             # multiple hist with data of different length
-            x = [np.array(xi) for xi in x]
+            x = [np.asarray(xi) for xi in x]

         nx = len(x) # number of datasets

@@ -7582,7 +7584,7 @@
         # We need to do to 'weights' what was done to 'x'
         if weights is not None:
             if isinstance(weights, np.ndarray) or not iterable(weights[0]) :
-                w = np.array(weights)
+                w = np.asarray(weights)
                 if w.ndim == 2:
                     w = w.T
                 elif w.ndim == 1:
@@ -7590,7 +7592,7 @@
                 else:
                     raise ValueError("weights must be 1D or 2D")
             else:
-                w = [np.array(wi) for wi in weights]
+                w = [np.asarray(wi) for wi in weights]

             if len(w) != nx:
                 raise ValueError('weights should have the same shape as x')

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to