History

python/aubio/task/onset.py: use numarray, not numpy (debian #478438)

Paul Brossier committed 17 years ago

Commit fcacd881 parent a250b351 file · +6 −6Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/aubio/task/onset.py+6−6
@@ -92,7 +92,7 @@ class taskonset(task): · 91 unmodified lines
9292 import Gnuplot, Gnuplot.funcutils
9393 import aubio.txtfile
9494 import os.path
95− import numarray
95+ from numpy import arange, array, ones
9696 from aubio.onsetcompare import onset_roc
9797
9898 x1,y1,y1p = [],[],[]
@@ -102,7 +102,7 @@ class taskonset(task): · 3 unmodified lines
102102 self.lenofunc = len(ofunc)
103103 self.maxofunc = max(ofunc)
104104 # onset detection function
105− downtime = numarray.arange(len(ofunc))*self.params.step
105+ downtime = arange(len(ofunc))*self.params.step
106106 oplot.append(Gnuplot.Data(downtime,ofunc,with='lines',title=self.params.onsetmode))
107107
108108 # detected onsets
@@ -111,8 +111,8 @@ class taskonset(task): · 2 unmodified lines
111111 x1.append(i[0]*self.params.step)
112112 y1.append(self.maxofunc)
113113 y1p.append(-self.maxofunc)
114− #x1 = numarray.array(onsets)*self.params.step
115− #y1 = self.maxofunc*numarray.ones(len(onsets))
114+ #x1 = array(onsets)*self.params.step
115+ #y1 = self.maxofunc*ones(len(onsets))
116116 if x1:
117117 oplot.append(Gnuplot.Data(x1,y1,with='impulses'))
118118 wplot.append(Gnuplot.Data(x1,y1p,with='impulses'))
@@ -126,8 +126,8 @@ class taskonset(task): · 7 unmodified lines
126126 self.title = "" #"(no ground truth)"
127127 else:
128128 t_onsets = aubio.txtfile.read_datafile(datafile)
129− x2 = numarray.array(t_onsets).resize(len(t_onsets))
130− y2 = self.maxofunc*numarray.ones(len(t_onsets))
129+ x2 = array(t_onsets).resize(len(t_onsets))
130+ y2 = self.maxofunc*ones(len(t_onsets))
131131 wplot.append(Gnuplot.Data(x2,y2,with='impulses'))
132132
133133 tol = 0.050

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t