shithub: aubio

Download patch

ref: e7a779466868f0177d60e302c979251a9dffe2fe
parent: 342e3807d1afbab8032e1d2b74c06f8fec6a92ed
author: Paul Brossier <piem@piem.org>
date: Sat Sep 26 02:34:28 EDT 2009

python: finish getting rid of numarray

--- a/python/aubio/onsetcompare.py
+++ b/python/aubio/onsetcompare.py
@@ -106,7 +106,7 @@
     return orig, missed, merged, expc, bad, doubled, l, labs
 
 def notes_roc (la, lb, eps):
-    from numarray import transpose, add, resize 
+    from numpy import transpose, add, resize 
     """ creates a matrix of size len(la)*len(lb) then look for hit and miss
     in it within eps tolerance windows """
     gdn,fpw,fpg,fpa,fdo,fdp = 0,0,0,0,0,0
--- a/python/aubio/plot/notes.py
+++ b/python/aubio/plot/notes.py
@@ -42,10 +42,10 @@
        
 
 def plotnote_withends(la,plot_title=None) :
-	import numarray
+	from numpy import array
 	import Gnuplot, Gnuplot.funcutils
 	d=[]
-	x_widths = numarray.array(la[:,1]-la[:,0])/2.
+	x_widths = array(la[:,1]-la[:,0])/2.
 	d.append(Gnuplot.Data(
 	        la[:,0]+x_widths,               # x centers
 	        la[:,2],                        # y centers
@@ -57,10 +57,10 @@
 
 def plotnote_withoutends(la,plot_title=None) :
         """ bug: fails drawing last note """
-	import numarray
+	from numpy import array
 	import Gnuplot, Gnuplot.funcutils
         d=[]
-        x_widths = numarray.array(la[1:,0]-la[:-1,0])/2;
+        x_widths = array(la[1:,0]-la[:-1,0])/2;
         d.append(Gnuplot.Data(
                 la[:-1,0]+x_widths,             # x centers
                 la[:-1,1],                      # y centers
--- a/python/aubiodiffs-onset
+++ b/python/aubiodiffs-onset
@@ -3,8 +3,6 @@
 """Copyright (C) 2004 Paul Brossier <piem@altern.org>
 
 print aubio.__LICENSE__ for the terms of use
-
-or see LICENSE.txt in the numarray installation directory.
 """
 __LICENSE__ = """\
 	 Copyright (C) 2004 Paul Brossier <piem@altern.org>
--- a/python/aubiofilter-notes
+++ b/python/aubiofilter-notes
@@ -78,7 +78,7 @@
 
         from aubio import notefilter,txtfile,gnuplot
         """ load midi and raw data """
-        from numarray import array
+        from numpy import array
         notelist = array(txtfile.read_datafile(input))
         """ filter it out """
         notelist_filtered = notefilter.segraw_onsets4(notelist,winlength,eps)
--- a/python/aubionotes
+++ b/python/aubionotes
@@ -4,7 +4,6 @@
 
     import aubio.aubioclass
     import aubio.median
-    #from numarray import around
     from math import floor
     hopsize   = 512
     bufsize   = 4096
--- a/python/aubioplot-notes
+++ b/python/aubioplot-notes
@@ -18,7 +18,7 @@
 def main (sysargs) :
     from aubio.txtfile import read_datafile
     from aubio.gnuplot import plotnote,plotnote_do 
-    from numarray import array
+    from numpy import array
     filein,fileout = parse_args(sysargs)
     #print 'checking', fileerr, 'against', fileorg
     """ load midi and raw data """
--- a/python/aubioweb.py
+++ b/python/aubioweb.py
@@ -11,7 +11,7 @@
 sndfile-programs (sndfile-info)
 vorbis-tools (oggenc)
 python-gnuplot
-python-numarray
+python-numpy
 
 Try the command line tools in aubio/python to test your installation.