diff --git a/MANIFEST.in b/MANIFEST.in index a38d6a23155982ab4e23f12197dda9fdbdebd4a6..03bf33faa460f666c4abc895536e93fe74f36dd1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ recursive-include doc *.rst *.py *.png *.bib -prune splearn/tests +#prune splearn/tests include *.txt include *.rst include VERSION diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..ef6315802d3b0f8d79b04704b505f8d8c9c176c2 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = scikit-splearn +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/doc/automaton.rst b/doc/automaton.rst deleted file mode 100644 index a5cf50d7bafa551c5f96937ec0fa9df3f2b2e703..0000000000000000000000000000000000000000 --- a/doc/automaton.rst +++ /dev/null @@ -1,7 +0,0 @@ -automaton module -================ - -.. automodule:: automaton - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/conf.py b/doc/conf.py index 744d5ff30d72b65859e494fabd6d5026be8633b5..029f55625d18976d3032d903b013797c9fba660d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,68 +1,63 @@ -#!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# scikit-splearn documentation build configuration file, created by -# sphinx-quickstart on Fri Nov 6 17:21:52 2015. +# Configuration file for the Sphinx documentation builder. # -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/stable/config -import sys -import os -import shlex +# -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # 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('../splearn')) +# +import os +import sys +import shlex +# sys.path.insert(0, os.path.abspath('.')) -# -- General configuration ------------------------------------------------ + +# -- Project information ----------------------------------------------------- + +project = 'scikit-splearn' +copyright = u'2018, François Denis, Remi Eyraud, Dominique Benielli, Denis Arrivault' +author = 'François Denis, Remi Eyraud, Dominique Benielli, Denis Arrivault' + +# The short X.Y version. +import splearn +version = splearn.__version__ +# The full version, including alpha/beta/rc tags. +release = version + +# -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# +# needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', - 'sphinx.ext.imgmath' + 'sphinx.ext.imgmath', + 'sphinx.ext.doctest', + 'sphinx.ext.coverage', ] # Add any paths that contain templates here, relative to this directory. -# templates_path = ['_templates'] +templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: +# # source_suffix = ['.rst', '.md'] source_suffix = '.rst' -# The encoding of source files. -#source_encoding = 'utf-8-sig' - # The master toctree document. master_doc = 'index' -# General information about the project. -project = 'scikit-splearn' -copyright = '2016, François Denis, Rémi Eyraud and Denis Arrivault and Dominique Benielli' -author = 'François Denis, Rémi Eyraud and Denis Arrivault and Dominique Benielli' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '1' -# The full version, including alpha/beta/rc tags. -release = '0' - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # @@ -70,220 +65,99 @@ release = '0' # Usually you set "language" from the command line for these cases. language = None -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -# exclude_patterns = ['_build'] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False +# This pattern also affects html_static_path and html_extra_path . +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'splearn.tests*'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = False - -# -- Options for HTML output ---------------------------------------------- +# -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'alabaster' +# +html_theme = 'nature' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# "<project> v<release> documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None +# +# html_theme_options = {} # 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'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +html_static_path = ['_static'] -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a <link> tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' -#html_search_language = 'en' +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -#html_search_options = {'type': 'default'} -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -#html_search_scorer = 'scorer.js' +# -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. htmlhelp_basename = 'scikit-splearndoc' -# -- Options for LaTeX output --------------------------------------------- + +# -- Options for LaTeX output ------------------------------------------------ latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', -# Latex figure (float) alignment -#'figure_align': 'htbp', + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'scikit-splearn.tex', 'scikit splearn Documentation', - 'François Denis, Rémi Eyraud, Denis Arrivault and dominique Benielli', - 'manual'), + (master_doc, 'scikit-splearn.tex', 'scikit-splearn Documentation', + 'François Denis, Remi Eyraud, Dominique Benielli, Denis Arrivault', 'manual'), ] -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- +# -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'scikit-splearn', 'scikit splearn Documentation', + (master_doc, 'scikit-splearn', 'scikit-splearn Documentation', [author], 1) ] -# If true, show URL addresses after external links. -#man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- +# -- Options for Texinfo output ---------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'scikit-splearn', 'scikit splearn Documentation', - author, 'scikit-splearn', 'One line description of project.', - 'Miscellaneous'), + (master_doc, 'scikit-splearn', 'scikit-splearn Documentation', + author, 'scikit-splearn', 'One line description of project.', + 'Miscellaneous'), ] -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False +# -- Extension configuration ------------------------------------------------- \ No newline at end of file diff --git a/doc/hankel.rst b/doc/hankel.rst deleted file mode 100644 index 6025e2254311e1cee4979b3611dcdf7f83864451..0000000000000000000000000000000000000000 --- a/doc/hankel.rst +++ /dev/null @@ -1,9 +0,0 @@ -hankel module -=============== - -.. automodule:: hankel - :members: - :undoc-members: - :show-inheritance: - - diff --git a/doc/index.rst b/doc/index.rst index c08fb7f1e9695a40dd8595b4e7d7381abf2f8051..99753e071d111b6506b11848f04095be9c602073 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,17 +1,16 @@ .. scikit-splearn documentation master file, created by - sphinx-quickstart on Fri Nov 6 17:21:52 2015. + sphinx-quickstart on Fri Feb 16 11:42:36 2018. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to scikit-splearn's documentation! ========================================== -Contents: - .. toctree:: - :maxdepth: 3 + :maxdepth: 2 + :caption: Contents: + - modules Indices and tables ================== @@ -19,4 +18,3 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` * :ref:`search` - diff --git a/doc/modules.rst b/doc/modules.rst index b26a62be4726070c6f06bcac7177d141a71c5fcb..d0ee3e02305605851b3afe3be92eff5f658426ee 100644 --- a/doc/modules.rst +++ b/doc/modules.rst @@ -2,9 +2,6 @@ splearn ======= .. toctree:: - :maxdepth: 2 + :maxdepth: 4 - automaton - spectral - hankel - splearn.datasets + splearn diff --git a/doc/spectral.rst b/doc/spectral.rst deleted file mode 100644 index 64157046d2c24e409d9af303419d3b5d0f82bc8b..0000000000000000000000000000000000000000 --- a/doc/spectral.rst +++ /dev/null @@ -1,7 +0,0 @@ -spectral module -=============== - -.. automodule:: spectral - :members: Learning, Spectral - :undoc-members: - :show-inheritance: diff --git a/doc/splearn.datasets.rst b/doc/splearn.datasets.rst index 20f52307cc77b8d2314a61383c86525eea695ca6..22f19d0b84f8d801b7eb90f3cf5df1222a5943e4 100644 --- a/doc/splearn.datasets.rst +++ b/doc/splearn.datasets.rst @@ -1,23 +1,30 @@ -splearn.datasets -================ +splearn.datasets package +======================== +Submodules +---------- -base ----- +splearn.datasets.base module +---------------------------- .. automodule:: splearn.datasets.base - :members: load_data_sample + :members: :undoc-members: :show-inheritance: - -data_sample ------------ +splearn.datasets.data\_sample module +------------------------------------ .. automodule:: splearn.datasets.data_sample - :members: DataSample , Splearn_array + :members: :undoc-members: :show-inheritance: +Module contents +--------------- +.. automodule:: splearn.datasets + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/splearn.rst b/doc/splearn.rst new file mode 100644 index 0000000000000000000000000000000000000000..c035342573f82ee49a6bab978c88f98b77a18fac --- /dev/null +++ b/doc/splearn.rst @@ -0,0 +1,53 @@ +splearn package +=============== + +Subpackages +----------- + +.. toctree:: + + splearn.datasets + +Submodules +---------- + +splearn.automaton module +------------------------ + +.. automodule:: splearn.automaton + :members: + :undoc-members: + :show-inheritance: + +splearn.hankel module +--------------------- + +.. automodule:: splearn.hankel + :members: + :undoc-members: + :show-inheritance: + +splearn.serializer module +------------------------- + +.. automodule:: splearn.serializer + :members: + :undoc-members: + :show-inheritance: + +splearn.spectral module +----------------------- + +.. automodule:: splearn.spectral + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: splearn + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/splearn.tests.datasets.rst b/doc/splearn.tests.datasets.rst new file mode 100644 index 0000000000000000000000000000000000000000..d3c07f89d351f9fef8e2488c0944fe9c1ab76c97 --- /dev/null +++ b/doc/splearn.tests.datasets.rst @@ -0,0 +1,22 @@ +splearn.tests.datasets package +============================== + +Submodules +---------- + +splearn.tests.datasets.get\_dataset\_path module +------------------------------------------------ + +.. automodule:: splearn.tests.datasets.get_dataset_path + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: splearn.tests.datasets + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/splearn.tests.rst b/doc/splearn.tests.rst new file mode 100644 index 0000000000000000000000000000000000000000..22a012f6812f7c14d515ace918a1e25e9d5be827 --- /dev/null +++ b/doc/splearn.tests.rst @@ -0,0 +1,62 @@ +splearn.tests package +===================== + +Submodules +---------- + +splearn.tests.test\_automaton module +------------------------------------ + +.. automodule:: splearn.tests.test_automaton + :members: + :undoc-members: + :show-inheritance: + +splearn.tests.test\_base module +------------------------------- + +.. automodule:: splearn.tests.test_base + :members: + :undoc-members: + :show-inheritance: + +splearn.tests.test\_data\_sample module +--------------------------------------- + +.. automodule:: splearn.tests.test_data_sample + :members: + :undoc-members: + :show-inheritance: + +splearn.tests.test\_hankel module +--------------------------------- + +.. automodule:: splearn.tests.test_hankel + :members: + :undoc-members: + :show-inheritance: + +splearn.tests.test\_serializer module +------------------------------------- + +.. automodule:: splearn.tests.test_serializer + :members: + :undoc-members: + :show-inheritance: + +splearn.tests.test\_spectral module +----------------------------------- + +.. automodule:: splearn.tests.test_spectral + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: splearn.tests + :members: + :undoc-members: + :show-inheritance: diff --git a/docker/Dockerfile b/docker/Dockerfile index 45a277be457331471ef1582be90e6b294fa11ace..d2d52e587289dfe7a805d7351960fa8717410b84 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y \ python3-scipy \ graphviz-dev RUN pip3 install --upgrade pip -RUN pip3 install nose coverage sphinx sphinxcontrib-bibtex +RUN pip3 install pyyaml nose coverage sphinx sphinxcontrib-bibtex # Copy the scikit-splearn sdist in the docker directory and uncomment the following line # if you want to include grackelpy sources in the docker image : diff --git a/setup.py b/setup.py index 01b12d9dc2ce131e256c6eeb1f815ec89315e9e7..37c9e14db8b58bda38dcba6bc8274dce9dcbd863 100755 --- a/setup.py +++ b/setup.py @@ -147,7 +147,8 @@ def setup_package(): long_description=(read('README.rst') + '\n\n' + read('HISTORY.rst') + '\n\n' + read('AUTHORS.rst')), - packages=["splearn", "splearn.datasets"], + packages=["splearn", "splearn.datasets", "splearn.tests", "splearn.tests.datasets"], + package_data={'splearn.tests.datasets': ['*.*']}, url="https://gitlab.lif.univ-mrs.fr/dominique.benielli/scikit-splearn.git", license='new BSD', author='François Denis and Rémi Eyraud and Denis Arrivault and Dominique Benielli', diff --git a/splearn/automaton.py b/splearn/automaton.py index 2d007e3f6a0746b1225b6bb54c4d3d30bf5c6c07..4413e358c1866e090996299cc39a9edabe8af608 100644 --- a/splearn/automaton.py +++ b/splearn/automaton.py @@ -662,6 +662,7 @@ class Automaton(object): def get_dot(self, threshold = 0., nb_dec = 2, title = "Weighted Automata"): """ Return a string that contains the Automata into dot (graphviz) format + :Example: >>> from splearn.datasets.base import load_data_sample @@ -681,7 +682,7 @@ class Automaton(object): - Input: :param Automaton self - :param float threshold for the value to keep. If |weight| < threshold, the + :param float threshold for the value to keep. If \|weight\| < threshold, the corresponding transition is not kept as an edge in the final dot string. :param int nb_dec is the number of decimals to keep for the weights. :param string title corresponds to the top comment of the string diff --git a/splearn/hankel.py b/splearn/hankel.py index f239f698a225929c6c497fbf7911b172c30b3a0b..1758ac98cbd61c82c66b34f70a91946385e9aa1d 100644 --- a/splearn/hankel.py +++ b/splearn/hankel.py @@ -45,7 +45,7 @@ class Hankel(object): """ A Hankel instance , compute the list of Hankel matrices :Example: - + >>> from splearn import Learning, Hankel , Spectral >>> train_file = '0.spice.train' >>> pT = load_data_sample(adr=train_file) @@ -56,9 +56,9 @@ class Hankel(object): >>> nbL=pT.nbL, nbEx=pT.nbEx, >>> lrows=6, lcolumns=6, version="classic", >>> partial=True, sparse=True, mode_quiet=True).lhankel - + - Input: - + :param dict sample_instance: sample dictionary :param dict pref: prefix dictionary :param dict suff: suffix dictionary @@ -81,7 +81,7 @@ class Hankel(object): matrix is sparse :param boolean mode_quiet: (default value = False) True for no output message. - :param list of all Hankel matrices. At least one of the two parameters + :param list lhankel: list of all Hankel matrices. At least one of the two parameters *sample_instance* or *lhankel* has to be not None. If *sample_instance* is given, the **Hankel** instance is built directly from the sample dictionnary, else it is deduced from the *lhankels* list of matrices.