projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8aaaff
)
aubio/__init__.py: simplify, add support for list input
author
Paul Brossier
<piem@piem.org>
Fri, 25 Dec 2009 05:13:14 +0000
(06:13 +0100)
committer
Paul Brossier
<piem@piem.org>
Fri, 25 Dec 2009 05:13:14 +0000
(06:13 +0100)
interfaces/python/aubio/__init__.py
patch
|
blob
|
history
diff --git
a/interfaces/python/aubio/__init__.py
b/interfaces/python/aubio/__init__.py
index 85c71808d191f637342f1a5c4fdfff5f3c08ba12..136848b111b857d52a2b400f0024aa21506dd7ce 100644
(file)
--- a/
interfaces/python/aubio/__init__.py
+++ b/
interfaces/python/aubio/__init__.py
@@
-3,9
+3,7
@@
from _aubio import *
class fvec(numpy.ndarray):
- def __init__(self, length = 1024, **kwargs):
- super(numpy.ndarray, self).__init__(**kwargs)
-
def __new__(self, length = 1024, **kwargs):
- self = numpy.zeros(length, dtype='float32', **kwargs)
- return self
+ if type(length) == type([]):
+ return numpy.array(length, dtype='float32', **kwargs)
+ return numpy.zeros(length, dtype='float32', **kwargs)