From 85a3bc97408dd8a4686ad6080d772448e4f0639f Mon Sep 17 00:00:00 2001 From: Denis Arrivault <denis.arrivault@lif.univ-mrs.fr> Date: Thu, 14 Jan 2016 16:39:31 +0100 Subject: [PATCH] Change version in doc + remove main functions from coverage + small doc errors corrections --- copyright.py | 5 ++++- copyrightstamp.txt | 10 +++++----- doc/conf.py | 17 ++++++++++++++--- doc/copyright.rst | 12 +++++------- doc/install.rst | 2 ++ ltfatpy/__init__.py | 2 +- ltfatpy/fourier/dcti.py | 2 +- ltfatpy/fourier/dctii.py | 2 +- ltfatpy/fourier/dctiii.py | 2 +- ltfatpy/fourier/dctiv.py | 2 +- ltfatpy/fourier/dsti.py | 2 +- ltfatpy/fourier/dstii.py | 2 +- ltfatpy/fourier/dstiii.py | 2 +- ltfatpy/fourier/dstiv.py | 2 +- ltfatpy/fourier/pgauss.py | 2 +- ltfatpy/fourier/pherm.py | 2 +- ltfatpy/fourier/psech.py | 2 +- ltfatpy/gabor/dgt.py | 2 +- ltfatpy/gabor/dgtreal.py | 2 +- ltfatpy/gabor/gabdual.py | 2 +- ltfatpy/gabor/gabimagepars.py | 2 +- ltfatpy/gabor/gabtight.py | 2 +- ltfatpy/gabor/idgt.py | 2 +- ltfatpy/gabor/idgtreal.py | 2 +- ltfatpy/gabor/instfreqplot.py | 2 +- ltfatpy/gabor/phaseplot.py | 2 +- ltfatpy/gabor/sgram.py | 2 +- ltfatpy/signals/greasy.py | 2 +- ltfatpy/sigproc/firwin.py | 2 +- ltfatpy/sigproc/thresh.py | 2 +- 30 files changed, 55 insertions(+), 41 deletions(-) diff --git a/copyright.py b/copyright.py index 430ca6e..9484119 100644 --- a/copyright.py +++ b/copyright.py @@ -69,7 +69,10 @@ def getVersionsAndDate(): def writeCopyrightRst(date, ltfatpy_version, ltfat_version): - stamp = open("copyrightstamp.txt").read() + stamp = "" + for line in open("copyrightstamp.txt"): + if "# COPYRIGHT #" not in line: + stamp += line stamp = stamp.replace("DATE", date) stamp = stamp.replace("LTFATPY_VERSION", ltfatpy_version) stamp = stamp.replace("LTFAT_VERSION", ltfat_version) diff --git a/copyrightstamp.txt b/copyrightstamp.txt index 3caeef4..eba801d 100644 --- a/copyrightstamp.txt +++ b/copyrightstamp.txt @@ -1,7 +1,7 @@ ######### COPYRIGHT ######### Copyright(c) DATE: ------------------ +------------------ * LabEx Archimède: http://labex-archimede.univ-amu.fr/ * Laboratoire d'Informatique Fondamentale : http://www.lif.univ-mrs.fr/ @@ -12,26 +12,26 @@ This software is a port from LTFAT LTFAT_VERSION : Copyright (C) 2005-DATE Peter L. Soendergaard <peter@sonderport.dk>. Contributors: ------------- +------------- * Denis Arrivault <contact.dev_AT_lif.univ-mrs.fr> * Florent Jaillet <contact.dev_AT_lif.univ-mrs.fr> Description: ------------ +------------ ltfatpy is a partial Python port of the Large Time/Frequency Analysis Toolbox (http://ltfat.sourceforge.net/), a MATLAB®/Octave toolbox for working with time-frequency analysis and synthesis. Version: -------- +-------- * ltfatpy version = LTFATPY_VERSION * LTFAT version = LTFAT_VERSION Licence: -------- +-------- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/doc/conf.py b/doc/conf.py index 7ed52a4..f7489c8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -17,6 +17,16 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) +# import os +# +# +# def get_version(): +# versionFile = os.path.join(os.pardir, 'VERSION') +# v_text = open(versionFile).read().strip() +# v_text_formted = '{"' + v_text.replace('\n', '","').replace(':', '":"') +# v_text_formted += '"}' +# v_dict = eval(v_text_formted) +# return v_dict["ltfatpy"] # -- General configuration ------------------------------------------------ @@ -61,9 +71,10 @@ copyright = u'2015, D. Arrivault, F. Jaillet' # built documents. # # The short X.Y version. -version = '1.0.0' +import ltfatpy +version = ltfatpy.__version__ # The full version, including alpha/beta/rc tags. -release = '1.0.0' +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -138,7 +149,7 @@ html_theme = "nature" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/doc/copyright.rst b/doc/copyright.rst index 1dff262..ba7cb0b 100644 --- a/doc/copyright.rst +++ b/doc/copyright.rst @@ -1,7 +1,6 @@ -######### COPYRIGHT ######### Copyright(c) 2016: ------------------ +------------------ * LabEx Archimède: http://labex-archimede.univ-amu.fr/ * Laboratoire d'Informatique Fondamentale : http://www.lif.univ-mrs.fr/ @@ -12,26 +11,26 @@ This software is a port from LTFAT 2.1.0 : Copyright (C) 2005-2016 Peter L. Soendergaard <peter@sonderport.dk>. Contributors: ------------- +------------- * Denis Arrivault <contact.dev_AT_lif.univ-mrs.fr> * Florent Jaillet <contact.dev_AT_lif.univ-mrs.fr> Description: ------------ +------------ ltfatpy is a partial Python port of the Large Time/Frequency Analysis Toolbox (http://ltfat.sourceforge.net/), a MATLAB®/Octave toolbox for working with time-frequency analysis and synthesis. Version: -------- +-------- * ltfatpy version = 1.0.4 * LTFAT version = 2.1.0 Licence: -------- +-------- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -46,4 +45,3 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. -######### COPYRIGHT ######### \ No newline at end of file diff --git a/doc/install.rst b/doc/install.rst index 4a13cb6..2ea3515 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -60,3 +60,5 @@ Before building documentation you have to install **sphinxcontrib-bibtex** : Then you have to use the setup.py build_sphinx command : ``python setup.py build_sphinx`` + +If errors occur, make sure you installed ltfatpy before building the sphinx documentation. diff --git a/ltfatpy/__init__.py b/ltfatpy/__init__.py index 31c06e9..413ffd2 100644 --- a/ltfatpy/__init__.py +++ b/ltfatpy/__init__.py @@ -117,4 +117,4 @@ __all__ = ["arg_firwin", "assert_groworder", "assert_sigreshape_post", "long2fir", "normalize", "rms", "thresh", "lcm", "postpad"] -__version__ = "1.0.3" +__version__ = "1.0.4" diff --git a/ltfatpy/fourier/dcti.py b/ltfatpy/fourier/dcti.py index d60ee8a..39507f6 100644 --- a/ltfatpy/fourier/dcti.py +++ b/ltfatpy/fourier/dcti.py @@ -118,6 +118,6 @@ def dcti(f, L=None, dim=None): c = comp_dct(f, 1) return assert_sigreshape_post(c, dim, permutedsize, order) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/dctii.py b/ltfatpy/fourier/dctii.py index f847aac..62e341f 100644 --- a/ltfatpy/fourier/dctii.py +++ b/ltfatpy/fourier/dctii.py @@ -116,6 +116,6 @@ def dctii(f, L=None, dim=None): return assert_sigreshape_post(c, dim, permutedsize, order) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/dctiii.py b/ltfatpy/fourier/dctiii.py index dda3fed..462da06 100644 --- a/ltfatpy/fourier/dctiii.py +++ b/ltfatpy/fourier/dctiii.py @@ -110,6 +110,6 @@ def dctiii(f, L=None, dim=None): c = comp_dct(f, 3) return assert_sigreshape_post(c, dim, permutedsize, order) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/dctiv.py b/ltfatpy/fourier/dctiv.py index 2bc6d96..cc02fb2 100644 --- a/ltfatpy/fourier/dctiv.py +++ b/ltfatpy/fourier/dctiv.py @@ -98,6 +98,6 @@ def dctiv(f, L=None, dim=None): c = comp_dct(f, 4) return assert_sigreshape_post(c, dim, permutedsize, order) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/dsti.py b/ltfatpy/fourier/dsti.py index e8aefb7..c3466ef 100644 --- a/ltfatpy/fourier/dsti.py +++ b/ltfatpy/fourier/dsti.py @@ -105,6 +105,6 @@ def dsti(f, L=None, dim=None): c = comp_dst(f, 1) return assert_sigreshape_post(c, dim, permutedsize, order) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/dstii.py b/ltfatpy/fourier/dstii.py index 13c32b4..c6945bd 100644 --- a/ltfatpy/fourier/dstii.py +++ b/ltfatpy/fourier/dstii.py @@ -108,6 +108,6 @@ def dstii(f, L=None, dim=None): c = comp_dst(f, 2) return assert_sigreshape_post(c, dim, permutedsize, order) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/dstiii.py b/ltfatpy/fourier/dstiii.py index 8598770..e613fd6 100644 --- a/ltfatpy/fourier/dstiii.py +++ b/ltfatpy/fourier/dstiii.py @@ -108,6 +108,6 @@ def dstiii(f, L=None, dim=None): c = comp_dst(f, 3) return assert_sigreshape_post(c, dim, permutedsize, order) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/dstiv.py b/ltfatpy/fourier/dstiv.py index 30c9c41..35ebc3b 100644 --- a/ltfatpy/fourier/dstiv.py +++ b/ltfatpy/fourier/dstiv.py @@ -99,6 +99,6 @@ def dstiv(f, L=None, dim=None): c = comp_dst(f, 4) return assert_sigreshape_post(c, dim, permutedsize, order) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/pgauss.py b/ltfatpy/fourier/pgauss.py index 3808505..18f8fad 100644 --- a/ltfatpy/fourier/pgauss.py +++ b/ltfatpy/fourier/pgauss.py @@ -145,6 +145,6 @@ def pgauss(L, tfr=1.0, fs=0.0, width=0.0, bw=0.0, c_f=0.0, centering='wp', g = normalize(g, norm)[0] return(g, tfr) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/pherm.py b/ltfatpy/fourier/pherm.py index 96a1eb2..047839a 100644 --- a/ltfatpy/fourier/pherm.py +++ b/ltfatpy/fourier/pherm.py @@ -217,6 +217,6 @@ def get_safe(order): safe = 12 return safe -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/fourier/psech.py b/ltfatpy/fourier/psech.py index b7aa102..d142bc5 100644 --- a/ltfatpy/fourier/psech.py +++ b/ltfatpy/fourier/psech.py @@ -106,6 +106,6 @@ def psech(L, tfr=None, s=None, **kwargs): g = g * np.sqrt(np.pi / (2 * np.sqrt(L*w))) return(g, tfr) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/dgt.py b/ltfatpy/gabor/dgt.py index 76713e2..aa4f537 100644 --- a/ltfatpy/gabor/dgt.py +++ b/ltfatpy/gabor/dgt.py @@ -192,6 +192,6 @@ def dgt(f, g, a, M, L=None, pt='freqinv'): return (c, Ls, gnum) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/dgtreal.py b/ltfatpy/gabor/dgtreal.py index a6854f2..89cf359 100644 --- a/ltfatpy/gabor/dgtreal.py +++ b/ltfatpy/gabor/dgtreal.py @@ -137,6 +137,6 @@ def dgtreal(f, g, a, M, L=None, pt='freqinv'): return (c, Ls, gnum) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/gabdual.py b/ltfatpy/gabor/gabdual.py index 7b3ca83..91be1a7 100644 --- a/ltfatpy/gabor/gabdual.py +++ b/ltfatpy/gabor/gabdual.py @@ -140,6 +140,6 @@ def _call_gabwin(g, a, M, L): return gabwin(g, a, M, L) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/gabimagepars.py b/ltfatpy/gabor/gabimagepars.py index c187824..6bedf19 100644 --- a/ltfatpy/gabor/gabimagepars.py +++ b/ltfatpy/gabor/gabimagepars.py @@ -127,6 +127,6 @@ def gabimagepars(Ls, x, y): return (a, M, L, N, Ngood) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/gabtight.py b/ltfatpy/gabor/gabtight.py index 23cb192..5f44e9c 100644 --- a/ltfatpy/gabor/gabtight.py +++ b/ltfatpy/gabor/gabtight.py @@ -148,6 +148,6 @@ def _call_gabwin(g, a, M, L): from ltfatpy.gabor.gabwin import gabwin return gabwin(g, a, M, L) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/idgt.py b/ltfatpy/gabor/idgt.py index 19a49ef..1a22471 100644 --- a/ltfatpy/gabor/idgt.py +++ b/ltfatpy/gabor/idgt.py @@ -150,6 +150,6 @@ def idgt(coef, g, a, Ls=None, pt='freqinv'): f = comp_sigreshape_post(f, Ls, 0, (0, W)) return (f, gnum) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/idgtreal.py b/ltfatpy/gabor/idgtreal.py index b88e624..7eff9b5 100644 --- a/ltfatpy/gabor/idgtreal.py +++ b/ltfatpy/gabor/idgtreal.py @@ -170,6 +170,6 @@ def idgtreal(coef, g, a, M, Ls=None, pt='freqinv'): f = comp_sigreshape_post(f, Ls, 0, (0, W)) return (f, g) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/instfreqplot.py b/ltfatpy/gabor/instfreqplot.py index 645de31..8e80eb7 100644 --- a/ltfatpy/gabor/instfreqplot.py +++ b/ltfatpy/gabor/instfreqplot.py @@ -168,6 +168,6 @@ def instfreqplot(f, fs=None, tfr=1., wlen=None, nf=None, thr=None, fmax=None, return coef -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/phaseplot.py b/ltfatpy/gabor/phaseplot.py index 6d2e0c8..4941b1e 100644 --- a/ltfatpy/gabor/phaseplot.py +++ b/ltfatpy/gabor/phaseplot.py @@ -161,6 +161,6 @@ def phaseplot(f, fs=None, tfr=1., wlen=None, nf=None, thr=None, fmax=None, return coef -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/gabor/sgram.py b/ltfatpy/gabor/sgram.py index 4592475..8e93793 100644 --- a/ltfatpy/gabor/sgram.py +++ b/ltfatpy/gabor/sgram.py @@ -177,6 +177,6 @@ def sgram(f, fs=None, tfr=1., wlen=None, nf=None, thr=None, fmax=None, return coef -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/signals/greasy.py b/ltfatpy/signals/greasy.py index 8aba8a5..6e48fd6 100644 --- a/ltfatpy/signals/greasy.py +++ b/ltfatpy/signals/greasy.py @@ -82,6 +82,6 @@ def greasy(): s = s.astype(np.float64) / 2.**15. return (s, fs) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() diff --git a/ltfatpy/sigproc/firwin.py b/ltfatpy/sigproc/firwin.py index 75be9e9..1775585 100644 --- a/ltfatpy/sigproc/firwin.py +++ b/ltfatpy/sigproc/firwin.py @@ -333,7 +333,7 @@ def firwin(name, M=0, x=None, **kwargs): return (g, info) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover (g, info) = firwin(name='sine', M=18, centering='wp') print(g) print(info) diff --git a/ltfatpy/sigproc/thresh.py b/ltfatpy/sigproc/thresh.py index 97324a2..290d5a3 100644 --- a/ltfatpy/sigproc/thresh.py +++ b/ltfatpy/sigproc/thresh.py @@ -144,6 +144,6 @@ def thresh(xi, lamb, thresh_type='hard'): return (xo, N) -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover import doctest doctest.testmod() -- GitLab