From e88fec365df90f20d9e98a6eca664688f12322f5 Mon Sep 17 00:00:00 2001 From: Maksym Kholiavchenko Date: Wed, 2 Oct 2019 21:31:07 +0300 Subject: [PATCH] Refactoring --- dependencies/scikit-tensor/README.md | 67 ----- dependencies/scikit-tensor/docs/conf.py | 276 ------------------ dependencies/scikit-tensor/docs/index.rst | 33 --- dependencies/scikit-tensor/docs/modules.rst | 6 - dependencies/scikit-tensor/docs/sktensor.rst | 118 -------- dependencies/scikit-tensor/docs/usage.rst | 20 -- .../examples/cp_sensory_bread_data.py | 15 - dependencies/scikit-tensor/setup.py | 3 - 8 files changed, 538 deletions(-) delete mode 100644 dependencies/scikit-tensor/README.md delete mode 100644 dependencies/scikit-tensor/docs/conf.py delete mode 100644 dependencies/scikit-tensor/docs/index.rst delete mode 100644 dependencies/scikit-tensor/docs/modules.rst delete mode 100644 dependencies/scikit-tensor/docs/sktensor.rst delete mode 100644 dependencies/scikit-tensor/docs/usage.rst delete mode 100755 dependencies/scikit-tensor/examples/cp_sensory_bread_data.py diff --git a/dependencies/scikit-tensor/README.md b/dependencies/scikit-tensor/README.md deleted file mode 100644 index 328fa5f..0000000 --- a/dependencies/scikit-tensor/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# scikit-tensor -![Travis CI](https://travis-ci.org/mnick/scikit-tensor.svg?branch=master) - -scikit-tensor is a Python module for multilinear algebra and tensor -factorizations. Currently, scikit-tensor supports basic tensor operations -such as folding/unfolding, tensor-matrix and tensor-vector products as -well as the following tensor factorizations: - -* Canonical / Parafac Decomposition -* Tucker Decomposition -* RESCAL -* DEDICOM -* INDSCAL - -Moreover, all operations support dense and tensors. - -#### Dependencies -The required dependencies to build the software are `Numpy >= 1.3`, `SciPy >= 0.7`. - -#### Usage -Example script to decompose sensory bread data (available from http://www.models.life.ku.dk/datasets) using CP-ALS - -```python -import logging -from scipy.io.matlab import loadmat -from sktensor import dtensor, cp_als - -# Set logging to DEBUG to see CP-ALS information -logging.basicConfig(level=logging.DEBUG) - -# Load Matlab data and convert it to dense tensor format -mat = loadmat('../data/sensory-bread/brod.mat') -T = dtensor(mat['X']) - -# Decompose tensor using CP-ALS -P, fit, itr, exectimes = cp_als(T, 3, init='random') -``` - -#### Install -This package uses distutils, which is the default way of installing python modules. The use of virtual environments is recommended. - - pip install scikit-tensor - -To install in development mode - - git clone git@github.com:mnick/scikit-tensor.git - pip install -e scikit-tensor/ - -#### Contributing & Development -scikit-tensor is still an extremely young project, and I'm happy for any contributions (patches, code, bugfixes, *documentation*, whatever) to get it to a stable and useful point. Feel free to get in touch with me via email (mnick at AT mit DOT edu) or directly via github. - -Development is synchronized via git. To clone this repository, run - - git clone git://github.com/mnick/scikit-tensor.git - -#### Authors -Maximilian Nickel: [Web](http://web.mit.edu/~mnick/www), [Email](mailto://mnick AT mit DOT edu), [Twitter](http://twitter.com/mnick) - -#### License -scikit-tensor is licensed under the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt) - -#### Related Projects -* [Matlab Tensor Toolbox](http://www.sandia.gov/~tgkolda/TensorToolbox/index-2.5.html): - A Matlab toolbox for tensor factorizations and tensor operations freely available for research and evaluation. -* [Matlab Tensorlab](http://www.tensorlab.net/) - A Matlab toolbox for tensor factorizations, complex optimization, and tensor optimization freely available for - non-commercial academic research. diff --git a/dependencies/scikit-tensor/docs/conf.py b/dependencies/scikit-tensor/docs/conf.py deleted file mode 100644 index 528c369..0000000 --- a/dependencies/scikit-tensor/docs/conf.py +++ /dev/null @@ -1,276 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# scikit-tensor documentation build configuration file, created by -# sphinx-quickstart on Sun Apr 20 14:28:17 2014. -# -# 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. - -import sys -import os -import sphinx_rtd_theme - -# 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('.')) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -# 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.pngmath', - 'sphinx.ext.napoleon', - 'sphinx.ext.autosummary', - 'numpydoc' -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -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-tensor' -copyright = '2016, Maximilian Nickel' - -# 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 = '0.1' -# The full version, including alpha/beta/rc tags. -release = '0.1' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# 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', '**tests**', '**setup**', '**extern**', - '**data**'] - -# 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 - -# 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 - - -# -- 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 = "sphinx_rtd_theme" - -# 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 = [sphinx_rtd_theme.get_html_theme_path()] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v 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 - -# 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 - -# 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 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 - -# Output file base name for HTML common builder. -htmlhelp_basename = 'dspydoc' - - -# -- Options for LaTeX output --------------------------------------------- - -pngmath_latex_preamble = ( - '\\usepackage{amsmath}\n' - '\\usepackage{amssymb}\n' - '\\newcommand{\\unfold}[2]{{#1}_{(#2)}}\n' - '\\newcommand{\\ten}[1]{\\mathcal{#1}}\n' - '\\newcommand{\\kr}{\\otimes}' -) - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - 'preamble': pngmath_latex_preamble, -} - -# 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 = [ - ('index', 'index.tex', 'scikit-tensor Documentation', - 'Maximilian Nickel', '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 --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'scikit-tensor', 'scikit-tensor Documentation', - ['Maximilian Nickel'], 1) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- 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 = [ - ('index', 'scikit-tensor', 'scikit-tensor Documentation', - 'Maximilian Nickel', 'scikit-tensor', - '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 diff --git a/dependencies/scikit-tensor/docs/index.rst b/dependencies/scikit-tensor/docs/index.rst deleted file mode 100644 index f376d7a..0000000 --- a/dependencies/scikit-tensor/docs/index.rst +++ /dev/null @@ -1,33 +0,0 @@ -Index -===== - -.. toctree:: - :maxdepth: 2 - - self - usage - modules - -scikit-tensor is a Python module for multilinear algebra and tensor factorizations. Currently, scikit-tensor supports basic tensor operations such as folding/unfolding, tensor-matrix and tensor-vector products as well as the following tensor factorizations: - - - Canonical / Parafac Decomposition - - Tucker Decomposition - - RESCAL - - DEDICOM - - INDSCAL - -Moreover, all operations support dense and tensors. - -Installation -============ - -.. code:: sh - - pip install scikit-tensor - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/dependencies/scikit-tensor/docs/modules.rst b/dependencies/scikit-tensor/docs/modules.rst deleted file mode 100644 index e6be825..0000000 --- a/dependencies/scikit-tensor/docs/modules.rst +++ /dev/null @@ -1,6 +0,0 @@ -Modules -======= - -.. toctree:: - - sktensor diff --git a/dependencies/scikit-tensor/docs/sktensor.rst b/dependencies/scikit-tensor/docs/sktensor.rst deleted file mode 100644 index 9947a34..0000000 --- a/dependencies/scikit-tensor/docs/sktensor.rst +++ /dev/null @@ -1,118 +0,0 @@ -sktensor package -================ - -Submodules ----------- - -sktensor.core module --------------------- - -.. automodule:: sktensor.core - :members: - :undoc-members: - :show-inheritance: - -sktensor.cp module ------------------- - -.. automodule:: sktensor.cp - :members: - :undoc-members: - :show-inheritance: - -sktensor.dedicom module ------------------------ - -.. automodule:: sktensor.dedicom - :members: - :undoc-members: - :show-inheritance: - -sktensor.dtensor module ------------------------ - -.. automodule:: sktensor.dtensor - :members: - :undoc-members: - :show-inheritance: - -sktensor.indscal module ------------------------ - -.. automodule:: sktensor.indscal - :members: - :undoc-members: - :show-inheritance: - -sktensor.ktensor module ------------------------ - -.. automodule:: sktensor.ktensor - :members: - :undoc-members: - :show-inheritance: - -sktensor.pyutils module ------------------------ - -.. automodule:: sktensor.pyutils - :members: - :undoc-members: - :show-inheritance: - -sktensor.rescal module ----------------------- - -.. automodule:: sktensor.rescal - :members: - :undoc-members: - :show-inheritance: - -sktensor.setup module ---------------------- - -.. automodule:: sktensor.setup - :members: - :undoc-members: - :show-inheritance: - -sktensor.sptensor module ------------------------- - -.. automodule:: sktensor.sptensor - :members: - :undoc-members: - :show-inheritance: - -sktensor.tucker module ----------------------- - -.. automodule:: sktensor.tucker - :members: - :undoc-members: - :show-inheritance: - -sktensor.utils module ---------------------- - -.. automodule:: sktensor.utils - :members: - :undoc-members: - :show-inheritance: - -sktensor.version module ------------------------ - -.. automodule:: sktensor.version - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: sktensor - :members: - :undoc-members: - :show-inheritance: diff --git a/dependencies/scikit-tensor/docs/usage.rst b/dependencies/scikit-tensor/docs/usage.rst deleted file mode 100644 index 9bb038a..0000000 --- a/dependencies/scikit-tensor/docs/usage.rst +++ /dev/null @@ -1,20 +0,0 @@ -Usage -===== - -Example script to decompose sensory bread data (available from http://www.models.life.ku.dk/datasets) using CP-ALS - -.. code:: python - - import logging - from scipy.io.matlab import loadmat - from sktensor import dtensor, cp_als - - # Set logging to DEBUG to see CP-ALS information - logging.basicConfig(level=logging.DEBUG) - - # Load Matlab data and convert it to dense tensor format - mat = loadmat('../data/sensory-bread/brod.mat') - T = dtensor(mat['X']) - - # Decompose tensor using CP-ALS - P, fit, itr, exectimes = cp_als(T, 3, init='random') diff --git a/dependencies/scikit-tensor/examples/cp_sensory_bread_data.py b/dependencies/scikit-tensor/examples/cp_sensory_bread_data.py deleted file mode 100755 index 461dffe..0000000 --- a/dependencies/scikit-tensor/examples/cp_sensory_bread_data.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env python - -import logging -from scipy.io.matlab import loadmat -from sktensor import dtensor, cp_als - -# Set logging to DEBUG to see CP-ALS information -logging.basicConfig(level=logging.DEBUG) - -# Load Matlab data and convert it to dense tensor format -mat = loadmat('../data/sensory-bread/brod.mat') -T = dtensor(mat['X']) - -# Decompose tensor using CP-ALS -P, fit, itr, exectimes = cp_als(T, 3, init='random') diff --git a/dependencies/scikit-tensor/setup.py b/dependencies/scikit-tensor/setup.py index c36c18f..c70c9ad 100644 --- a/dependencies/scikit-tensor/setup.py +++ b/dependencies/scikit-tensor/setup.py @@ -6,8 +6,6 @@ DISTNAME = 'scikit-tensor' DESCRIPTION = descr -with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f: - LONG_DESCRIPTION = f.read() MAINTAINER = 'Maximilian Nickel', MAINTAINER_EMAIL = 'mnick@mit.edu', URL = 'http://github.com/mnick/scikit-tensor' @@ -81,7 +79,6 @@ def setup_package(): license=LICENSE, url=URL, download_url=DOWNLOAD_URL, - long_description=LONG_DESCRIPTION, version=get_version(), install_requires=[ 'numpy',