]> git.parisson.com Git - timeside.git/commitdiff
Doc : Add documentation for analyzer preprocessor decorators
authorThomas Fillon <thomas@parisson.com>
Fri, 15 Nov 2013 20:11:00 +0000 (21:11 +0100)
committerThomas Fillon <thomas@parisson.com>
Fri, 15 Nov 2013 20:11:00 +0000 (21:11 +0100)
doc/source/api/analyzer/index.rst
doc/source/api/analyzer/preprocessors.rst [new file with mode: 0644]
timeside/analyzer/preprocessors.py

index d21dd91b35a2729e82d9d0e95909d6790a0385ed..5b4575fc251b29f06037e255131ce6d6c11433e9 100644 (file)
@@ -7,6 +7,7 @@ Analyzer package
 
    Analyzer Core module <core>
    Analyzers processors <analyzers>
+   Analyzer preprocessors <preprocessors>
     
 
              
diff --git a/doc/source/api/analyzer/preprocessors.rst b/doc/source/api/analyzer/preprocessors.rst
new file mode 100644 (file)
index 0000000..958dab1
--- /dev/null
@@ -0,0 +1,18 @@
+===============
+ Preprocessors
+===============
+
+.. toctree::
+
+.. automodule:: timeside.analyzer.preprocessors
+   
+
+downmix_to_mono
+===============
+ .. autofunction:: timeside.analyzer.preprocessors.downmix_to_mono
+
+
+
+frames_adapter
+==============
+ .. autofunction:: timeside.analyzer.preprocessors.frames_adapter
index d1dd8b3b23b12729c13cc413479810e8bf1bcbac..bf9fda24db2dd31bfdaf874db0e47578d0a5f086 100644 (file)
@@ -34,6 +34,7 @@ def downmix_to_mono(process_func):
 
     Downmix is achieved by averaging all channels
 
+    >>> from timeside.analyzer.preprocessors import downmix_to_mono
     >>> @downmix_to_mono
     ... def process(analyzer,frames,eod):
     ...     print 'Frames, eod inside process :'
@@ -48,6 +49,7 @@ def downmix_to_mono(process_func):
     [ 1.5  3.5  5.5  7.5  9.5] False
 
     Outside Process frames and eod are preserved :
+
     >>> frames_
     array([[ 1,  2],
            [ 3,  4],
@@ -79,6 +81,7 @@ def frames_adapter(process_func):
     Pre-processing decorator that adapt frames to match input_blocksize and
     input_stepsize of the decorated analyzer
 
+    >>> from timeside.analyzer.preprocessors import frames_adapter
     >>> @frames_adapter
     ... def process(analyzer,frames,eod):
     ...     analyzer.frames.append(frames)
@@ -97,16 +100,19 @@ def frames_adapter(process_func):
 
     Inside the process the frames have been adapted to match input_blocksize
     and input_stepsize
+
     >>> analyzer.frames
     [array([0, 1, 2, 3]), array([3, 4, 5, 6]), array([6, 7, 8, 9])]
 
-    Outside the process, the original frames and eod are preserved :
+    Outside the process, the original frames and eod are preserved:
+
     >>> frames_
     array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11])
     >>> eod_
     False
 
     Releasing the process with eod=True will zeropad the last frame if necessary
+
     >>> frames = np.asarray(range(12,14))
     >>> eod = True
     >>> frames_, eod_ = process(analyzer,frames,eod)