From: Thomas Fillon Date: Tue, 16 Dec 2014 14:04:25 +0000 (+0100) Subject: Fix ProcessPipe: proper copy of processor already in pipe X-Git-Tag: 0.7^2~39 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9df61a8684ee2558010ee04faf7a1d89476a0cf1;p=timeside.git Fix ProcessPipe: proper copy of processor already in pipe --- diff --git a/tests/test_process_pipe.py b/tests/test_process_pipe.py index b503efb..fd7e1f2 100755 --- a/tests/test_process_pipe.py +++ b/tests/test_process_pipe.py @@ -25,11 +25,15 @@ class TestProcessPipe(unittest.TestCase): dec2 = FileDecoder(source) self.assertRaises(ValueError, pipe.append_processor, dec2) - a = timeside.analyzer.odf.OnsetDetectionFunction() - abis = timeside.analyzer.odf.OnsetDetectionFunction() + odf = timeside.analyzer.odf.OnsetDetectionFunction() + odf2 = timeside.analyzer.odf.OnsetDetectionFunction() - a2 = timeside.analyzer.spectrogram.Spectrogram() - pipe2 = (dec | a | a2 | abis) + spectro2 = timeside.analyzer.spectrogram.Spectrogram() + pipe2 = (dec | odf | spectro2 | odf2) + + self.assertEqual(pipe2, odf.process_pipe) + self.assertEqual(pipe2, odf2.process_pipe) + self.assertEqual(pipe2, spectro2.process_pipe) self.assertEqual(len(pipe2.processors), 4) # Release temporary buffers in Spectrogram diff --git a/timeside/core.py b/timeside/core.py index 917752f..d724bf5 100644 --- a/timeside/core.py +++ b/timeside/core.py @@ -353,6 +353,7 @@ class ProcessPipe(object): child_proc = self._graph.node[child]['processor'] if proc == child_proc: proc.UUID = child_proc.UUID + proc.process_pipe = self break if not self._graph.has_node(proc.uuid()): self.processors.append(proc) # Add processor to the pipe