python: finish getting rid of numarray
authorPaul Brossier <piem@piem.org>
Sat, 26 Sep 2009 04:34:28 +0000 (06:34 +0200)
committerPaul Brossier <piem@piem.org>
Sat, 26 Sep 2009 04:34:28 +0000 (06:34 +0200)
python/aubio/onsetcompare.py
python/aubio/plot/notes.py
python/aubiodiffs-onset
python/aubiofilter-notes
python/aubionotes
python/aubioplot-notes
python/aubioweb.py

index 1cfe2af..3c268bd 100644 (file)
@@ -106,7 +106,7 @@ def onset_rocloc(ltru, lexp, eps):
     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
index f76d2cf..e4f6507 100644 (file)
@@ -42,10 +42,10 @@ def plotnote_multi(lalist,title=None,fileout=None) :
        
 
 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_withends(la,plot_title=None) :
 
 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
index 67e2f59..29df4d7 100755 (executable)
@@ -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>
index 9f8d6d7..7e7e08b 100755 (executable)
@@ -78,7 +78,7 @@ def main():
 
         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)
index bc99184..a00bbea 100755 (executable)
@@ -4,7 +4,6 @@ def do(filein,threshold):
 
     import aubio.aubioclass
     import aubio.median
-    #from numarray import around
     from math import floor
     hopsize   = 512
     bufsize   = 4096
index 5aeb922..e6f9de2 100755 (executable)
@@ -18,7 +18,7 @@ def parse_args (sysargs):
 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 """
index 59c41c5..36fe4c3 100644 (file)
@@ -11,7 +11,7 @@ libapache-mod-python (apache2 prefered)
 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.