History

python/aubio: use Gnuplot.Data with_ keywords, with is a reserved keyword in python 2.6 (debian #512622)

Paul Brossier committed 17 years ago

Commit 5f23f661 parent 55ed67a7 files · +26 −26Browse files

Showing the changes to python (7 of 7 files). Show all

Unified · Split

7 files
  1. python/aubio/bench/onset.py +6 −6
  2. python/aubio/plot/notes.py +2 −2
  3. python/aubio/task/beat.py +2 −2
  4. python/aubio/task/notes.py +5 −5
  5. python/aubio/task/onset.py +5 −5
  6. python/aubio/task/pitch.py +2 −2
  7. python/aubioplot-yinfft +4 −4
python/aubio/bench/onset.py+6−6
@@ -111,7 +111,7 @@ class benchonset(bench): · 110 unmodified lines
111111 for i in self.vlist:
112112 gd.append(i['GD'])
113113 fp.append(i['FP'])
114− d.append(Gnuplot.Data(fp, gd, with='linespoints',
114+ d.append(Gnuplot.Data(fp, gd, with_='linespoints',
115115 title="%s %s" % (plottitle,i['mode']) ))
116116
117117 def plotplotroc(self,d,outplot=0,extension='ps'):
@@ -147,7 +147,7 @@ class benchonset(bench): · 29 unmodified lines
147147 for i in self.vlist:
148148 x.append(i['prec'])
149149 y.append(i['recl'])
150− d.append(Gnuplot.Data(x, y, with='linespoints',
150+ d.append(Gnuplot.Data(x, y, with_='linespoints',
151151 title="%s %s" % (plottitle,i['mode']) ))
152152
153153 def plotplotpr(self,d,outplot=0,extension='ps'):
@@ -172,7 +172,7 @@ class benchonset(bench): · 18 unmodified lines
172172 for i in self.vlist:
173173 x.append(i['thres'])
174174 y.append(i['dist'])
175− d.append(Gnuplot.Data(x, y, with='linespoints',
175+ d.append(Gnuplot.Data(x, y, with_='linespoints',
176176 title="%s %s" % (plottitle,i['mode']) ))
177177
178178 def plotplotfmeas(self,d,outplot="",extension='ps', title="F-measure"):
@@ -205,7 +205,7 @@ class benchonset(bench): · 26 unmodified lines
205205 for i in self.vlist:
206206 x.append(i[var])
207207 y.append(i['dist'])
208− d.append(Gnuplot.Data(x, y, with='linespoints',
208+ d.append(Gnuplot.Data(x, y, with_='linespoints',
209209 title="%s %s" % (plottitle,i['mode']) ))
210210
211211 def plotplotfmeasvar(self,d,var,outplot="",extension='ps', title="F-measure"):
@@ -244,7 +244,7 @@ class benchonset(bench): · 32 unmodified lines
244244 total = v['Torig']
245245 for i in range(len(per)): per[i] /= total/100.
246246
247− d.append(Gnuplot.Data(val, per, with='fsteps',
247+ d.append(Gnuplot.Data(val, per, with_='fsteps',
248248 title="%s %s" % (plottitle,v['mode']) ))
249249 #d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (mean,smean))
250250 #d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (amean,samean))
@@ -275,7 +275,7 @@ class benchonset(bench): · 24 unmodified lines
275275 total = v['Torig']
276276 for i in range(len(per)): per[i] /= total/100.
277277
278− d.append(Gnuplot.Data(val, per, with='fsteps',
278+ d.append(Gnuplot.Data(val, per, with_='fsteps',
279279 title="%s %s" % (plottitle,v['mode']) ))
280280 #d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (mean,smean))
281281 #d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (amean,samean))
python/aubio/plot/notes.py+2−2
@@ -51,7 +51,7 @@ def plotnote_withends(la,plot_title=None) : · 50 unmodified lines
5151 la[:,2], # y centers
5252 x_widths, # x errors
5353 __notesheight*ones(len(la)), # y errors
54− title=plot_title,with=('boxxyerrorbars fs 3')))
54+ title=plot_title,with_=('boxxyerrorbars fs 3')))
5555 return d
5656
5757
@@ -66,7 +66,7 @@ def plotnote_withoutends(la,plot_title=None) : · 8 unmodified lines
6666 la[:-1,1], # y centers
6767 x_widths, # x errors
6868 __notesheight*ones(len(la)-1), # y errors
69− title=plot_title,with=('boxxyerrorbars fs 3')))
69+ title=plot_title,with_=('boxxyerrorbars fs 3')))
7070 return d
7171
7272 def plotnote_do(d,fileout=None):
python/aubio/task/beat.py+2−2
@@ -247,7 +247,7 @@ class taskbeat(taskonset): · 246 unmodified lines
247247
248248 def plot(self,oplots,results):
249249 import Gnuplot
250− oplots.append(Gnuplot.Data(results,with='linespoints',title="auto"))
250+ oplots.append(Gnuplot.Data(results,with_='linespoints',title="auto"))
251251
252252 def plotplot(self,wplot,oplots,outplot=None,extension=None,xsize=1.,ysize=1.,spectro=False):
253253 import Gnuplot
@@ -258,5 +258,5 @@ class taskbeat(taskonset): · 4 unmodified lines
258258 #f = make_audio_plot(time,data)
259259
260260 g = gnuplot_create(outplot=outplot, extension=extension)
261− oplots = [Gnuplot.Data(self.gettruth(),with='linespoints',title="orig")] + oplots
261+ oplots = [Gnuplot.Data(self.gettruth(),with_='linespoints',title="orig")] + oplots
262262 g.plot(*oplots)
python/aubio/task/notes.py+5−5
@@ -94,15 +94,15 @@ class tasknotes(task): · 93 unmodified lines
9494 def plot(self,now,onset,freq,ifreq,oplots):
9595 import Gnuplot
9696
97− oplots.append(Gnuplot.Data(now,freq,with='lines',
97+ oplots.append(Gnuplot.Data(now,freq,with_='lines',
9898 title=self.params.pitchmode))
99− oplots.append(Gnuplot.Data(now,ifreq,with='lines',
99+ oplots.append(Gnuplot.Data(now,ifreq,with_='lines',
100100 title=self.params.pitchmode))
101101
102102 temponsets = []
103103 for i in onset:
104104 temponsets.append(i*1000)
105− oplots.append(Gnuplot.Data(now,temponsets,with='impulses',
105+ oplots.append(Gnuplot.Data(now,temponsets,with_='impulses',
106106 title=self.params.pitchmode))
107107
108108 def plotplot(self,wplot,oplots,outplot=None,multiplot = 0):
@@ -116,10 +116,10 @@ class tasknotes(task): · 7 unmodified lines
116116 # check if ground truth exists
117117 #timet,pitcht = self.gettruth()
118118 #if timet and pitcht:
119− # oplots = [Gnuplot.Data(timet,pitcht,with='lines',
119+ # oplots = [Gnuplot.Data(timet,pitcht,with_='lines',
120120 # title='ground truth')] + oplots
121121
122− t = Gnuplot.Data(0,0,with='impulses')
122+ t = Gnuplot.Data(0,0,with_='impulses')
123123
124124 g = gnuplot_init(outplot)
125125 g('set title \'%s\'' % (re.sub('.*/','',self.input)))
python/aubio/task/onset.py+5−5
@@ -92,7 +92,7 @@ class taskonset(task): · 91 unmodified lines
9292 import Gnuplot, Gnuplot.funcutils
9393 import aubio.txtfile
9494 import os.path
95− from numpy import arange, array, ones
95+ from numpy import arange, array, ones
9696 from aubio.onsetcompare import onset_roc
9797
9898 x1,y1,y1p = [],[],[]
@@ -103,7 +103,7 @@ class taskonset(task): · 4 unmodified lines
103103 self.maxofunc = max(ofunc)
104104 # onset detection function
105105 downtime = arange(len(ofunc))*self.params.step
106− oplot.append(Gnuplot.Data(downtime,ofunc,with='lines',title=self.params.onsetmode))
106+ oplot.append(Gnuplot.Data(downtime,ofunc,with_='lines',title=self.params.onsetmode))
107107
108108 # detected onsets
109109 if not nplot:
@@ -114,8 +114,8 @@ class taskonset(task): · 4 unmodified lines
114114 #x1 = array(onsets)*self.params.step
115115 #y1 = self.maxofunc*ones(len(onsets))
116116 if x1:
117− oplot.append(Gnuplot.Data(x1,y1,with='impulses'))
118− wplot.append(Gnuplot.Data(x1,y1p,with='impulses'))
117+ oplot.append(Gnuplot.Data(x1,y1,with_='impulses'))
118+ wplot.append(Gnuplot.Data(x1,y1p,with_='impulses'))
119119
120120 oplots.append((oplot,self.params.onsetmode,self.maxofunc))
121121
@@ -128,7 +128,7 @@ class taskonset(task): · 6 unmodified lines
128128 t_onsets = aubio.txtfile.read_datafile(datafile)
129129 x2 = array(t_onsets).resize(len(t_onsets))
130130 y2 = self.maxofunc*ones(len(t_onsets))
131− wplot.append(Gnuplot.Data(x2,y2,with='impulses'))
131+ wplot.append(Gnuplot.Data(x2,y2,with_='impulses'))
132132
133133 tol = 0.050
134134
python/aubio/task/pitch.py+2−2
@@ -156,7 +156,7 @@ class taskpitch(task): · 155 unmodified lines
156156
157157 time = [ (i+self.params.pitchdelay)*self.params.step for i in range(len(pitch)) ]
158158 pitch = [aubio_freqtomidi(i) for i in pitch]
159− oplots.append(Gnuplot.Data(time,pitch,with='lines',
159+ oplots.append(Gnuplot.Data(time,pitch,with_='lines',
160160 title=self.params.pitchmode))
161161 titles.append(self.params.pitchmode)
162162
@@ -170,7 +170,7 @@ class taskpitch(task): · 7 unmodified lines
170170 if truth:
171171 timet,pitcht = self.gettruth()
172172 if timet and pitcht:
173− oplots = [Gnuplot.Data(timet,pitcht,with='lines',
173+ oplots = [Gnuplot.Data(timet,pitcht,with_='lines',
174174 title='ground truth')] + oplots
175175
176176 g = gnuplot_create(outplot=outplot, extension=extension)
python/aubioplot-yinfft+4−4
@@ -73,10 +73,10 @@ while (taskfile.readsize == params.hopsize): · 72 unmodified lines
7373 y = [yin.get(i,0) for i in range(params.bufsize/2)]
7474 thresh = [0.1 for i in range(params.bufsize/2)]
7575 #t.append((i/float(params.hopsize)+taskfile.frameread)*params.step),t.pop(0)
76− d = [plotdata(n,a,plottitle="signal", with='lines'),
77− plotdata(n,c,plottitle="d[t]",axes='x1y2', with='lines lt 1'),
78− plotdata(n,y,plottitle="d'[t]",axes='x1y1', with='lines lt 2'),
79− plotdata(n,thresh,plottitle="threshold",axes='x1y1', with='lines lt 3')]
76+ d = [plotdata(n,a,plottitle="signal", with_='lines'),
77+ plotdata(n,c,plottitle="d[t]",axes='x1y2', with_='lines lt 1'),
78+ plotdata(n,y,plottitle="d'[t]",axes='x1y1', with_='lines lt 2'),
79+ plotdata(n,thresh,plottitle="threshold",axes='x1y1', with_='lines lt 3')]
8080 #g('set xrange [%f:%f]' % (t[0],t[-1]))
8181 #time.sleep(.2)
8282 g.reset()

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