From: Paul Brossier Date: Sat, 26 Sep 2009 04:34:28 +0000 (+0200) Subject: python: finish getting rid of numarray X-Git-Tag: bzr2git~281 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e7a779466868f0177d60e302c979251a9dffe2fe;p=aubio.git python: finish getting rid of numarray --- diff --git a/python/aubio/onsetcompare.py b/python/aubio/onsetcompare.py index 1cfe2af4..3c268bd0 100644 --- a/python/aubio/onsetcompare.py +++ b/python/aubio/onsetcompare.py @@ -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 diff --git a/python/aubio/plot/notes.py b/python/aubio/plot/notes.py index f76d2cf6..e4f65075 100644 --- a/python/aubio/plot/notes.py +++ b/python/aubio/plot/notes.py @@ -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 diff --git a/python/aubiodiffs-onset b/python/aubiodiffs-onset index 67e2f59c..29df4d7e 100755 --- a/python/aubiodiffs-onset +++ b/python/aubiodiffs-onset @@ -3,8 +3,6 @@ """Copyright (C) 2004 Paul Brossier print aubio.__LICENSE__ for the terms of use - -or see LICENSE.txt in the numarray installation directory. """ __LICENSE__ = """\ Copyright (C) 2004 Paul Brossier diff --git a/python/aubiofilter-notes b/python/aubiofilter-notes index 9f8d6d7a..7e7e08b8 100755 --- a/python/aubiofilter-notes +++ b/python/aubiofilter-notes @@ -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) diff --git a/python/aubionotes b/python/aubionotes index bc991848..a00bbea9 100755 --- a/python/aubionotes +++ b/python/aubionotes @@ -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 diff --git a/python/aubioplot-notes b/python/aubioplot-notes index 5aeb9229..e6f9de2f 100755 --- a/python/aubioplot-notes +++ b/python/aubioplot-notes @@ -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 """ diff --git a/python/aubioweb.py b/python/aubioweb.py index 59c41c54..36fe4c33 100644 --- a/python/aubioweb.py +++ b/python/aubioweb.py @@ -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.