Ignore:
Timestamp:
May 16, 2016, 5:08:18 AM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
a6f9ebf
Parents:
58a5fb9
Message:

python/tests: fix most prospect warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_pitch.py

    r58a5fb9 r0b6d23d  
    11#! /usr/bin/env python
    22
    3 from unittest import TestCase
    4 from numpy.testing import assert_equal, assert_almost_equal
    5 from numpy import random, sin, arange, mean, median, isnan
    6 from math import pi
     3from unittest import TestCase, main
     4from numpy.testing import assert_equal
     5from numpy import sin, arange, mean, median, isnan, pi
    76from aubio import fvec, pitch, freqtomidi, float_type
    87
     
    2524        p = pitch('default', 2048, 512, 32000)
    2625        f = fvec (512)
    27         for i in range(10): assert_equal (p(f), 0.)
     26        for _ in range(10): assert_equal (p(f), 0.)
    2827
    2928    def test_run_on_ones(self):
     
    3231        f = fvec (512)
    3332        f[:] = 1
    34         for i in range(10): assert_equal (p(f), 0.)
     33        for _ in range(10): assert_equal (p(f), 0.)
    3534
    3635class aubio_pitch_Sinusoid(TestCase):
     
    5453
    5554    def run_pitch(self, p, input_vec, freq):
    56         count = 0
    5755        pitches, errors = [], []
    5856        input_blocks = input_vec.reshape((-1, p.hop_size))
     
    6462        assert_equal ( isnan(pitches), False )
    6563        # cut the first candidates
    66         cut = ( p.buf_size - p.hop_size ) / p.hop_size
     64        #cut = ( p.buf_size - p.hop_size ) / p.hop_size
    6765        pitches = pitches[2:]
    6866        errors = errors[2:]
     
    125123
    126124if __name__ == '__main__':
    127     from unittest import main
    128125    main()
Note: See TracChangeset for help on using the changeset viewer.