Modèles

On dispose de modèles:

Modules

La structure d’un module est variable; le modèle est un minimum

#-*-coding:utf-8-*-
# <le chemin et le nom du module>

""" le doc-string """

from yyyyyyyyyyyyyyyyy import Xccccccccc

__author__ = "Copyright (c) <année> <nom>"
__date__ = "<date>"

# les fonctions et les classes>

if __name__ == "__main__":
    execfile("t_<module>.py")

Tests

Voici mon python de test de base.

#-*-coding:utf-8-*-
# test_module.py

"""  test du <module> """

import numpy as np

from samplerate import sr
from conversions import prony2freq, extremum
from profilbase import ProfilBase
from profils import recta, cubica, affprofil
from canal import CanalMono, record
from reverberation import Reverberation
from serie import Serie002
from origine import OrigineStr
from dico_enveloppes import enveloppes

def test1():
    "test 1"
    pass

def test2():
    "test 2"
    pass

def test3():
    "test 3"
    pass

def test4():
    "test 4"
    pass


if __name__ == "__main__":
    import versionneur
    import sys
    import time
    from taudio import play16, play64

    t0 = time.time()
    dico = {}

    for i in range(10):
        dico[i] = "test" + str(i) + "()"
    try:
        ntest = int(sys.argv[-1])
    except ValueError:
        ntest = int(raw_input("Quel test ? "))

    exec(dico[ntest])

    versionneur.fairecopienumero(__file__)
    t1 = time.time()
    print "Durée du calcul", t1 - t0