Repository: systemml
Updated Branches:
  refs/heads/master 4744da167 -> c249c6fdf


[SYSTEMML-1825] Add sphinx build files for Python API doc generation

Added files for generating Python API documentation with Sphinx.

Closes #646.


Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/c249c6fd
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/c249c6fd
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/c249c6fd

Branch: refs/heads/master
Commit: c249c6fdfeff23833faca0ecfe8399e4d54bee71
Parents: 4744da1
Author: Glenn Weidner <[email protected]>
Authored: Wed Aug 30 14:52:36 2017 -0700
Committer: Glenn Weidner <[email protected]>
Committed: Wed Aug 30 14:52:37 2017 -0700

----------------------------------------------------------------------
 pom.xml                                 |   2 +
 src/main/pythondoc/Makefile             |  37 +++++
 src/main/pythondoc/conf.py              | 211 +++++++++++++++++++++++++++
 src/main/pythondoc/index.rst            |  21 +++
 src/main/pythondoc/make.bat             |  57 ++++++++
 src/main/pythondoc/systemml.mllearn.rst |  22 +++
 src/main/pythondoc/systemml.random.rst  |  22 +++
 src/main/pythondoc/systemml.rst         |  54 +++++++
 8 files changed, 426 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/c249c6fd/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0ee382c..4bbe714 100644
--- a/pom.xml
+++ b/pom.xml
@@ -878,6 +878,8 @@
                                                                
<exclude>src/main/java/*.tokens</exclude>
                                                                <!-- Generated 
python files -->
                                                                
<exclude>src/main/python/systemml.egg-info/**</exclude>
+                                                               <!-- Sphinx 
reStructuredText files -->
+                                                               
<exclude>src/main/pythondoc/*.rst</exclude>
                                                                <!-- Compiled 
ptx file from nvcc -->
                                                                
<exclude>src/main/cpp/kernels/SystemML.ptx</exclude>
                                                                <!-- Proto 
files -->

http://git-wip-us.apache.org/repos/asf/systemml/blob/c249c6fd/src/main/pythondoc/Makefile
----------------------------------------------------------------------
diff --git a/src/main/pythondoc/Makefile b/src/main/pythondoc/Makefile
new file mode 100644
index 0000000..e68aeaf
--- /dev/null
+++ b/src/main/pythondoc/Makefile
@@ -0,0 +1,37 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Minimal makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = python -msphinx
+SPHINXPROJ    = SystemML
+SOURCEDIR     = .
+BUILDDIR      = ../../../target/pydocs
+
+# 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)

http://git-wip-us.apache.org/repos/asf/systemml/blob/c249c6fd/src/main/pythondoc/conf.py
----------------------------------------------------------------------
diff --git a/src/main/pythondoc/conf.py b/src/main/pythondoc/conf.py
new file mode 100644
index 0000000..11ca735
--- /dev/null
+++ b/src/main/pythondoc/conf.py
@@ -0,0 +1,211 @@
+# -*- coding: utf-8 -*-
+#
+#-------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+#
+# SystemML documentation build configuration file, created by
+# sphinx-quickstart on Thu Aug 24 11:58:36 2017.
+#
+# 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.
+
+# 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.
+#
+import os
+import sys
+sys.path.insert(0, os.path.abspath('../python'))
+
+
+# -- 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.napoleon']
+
+# Add any paths that contain templates here, relative to this directory.
+# 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 master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'SystemML'
+copyright = u'2017 The Apache Software Foundation.  All rights reserved'
+author = u''
+
+# 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 = os.environ.get('SYSTEMML_VERSION', 'latest')
+# The full version, including alpha/beta/rc tags.
+release = os.environ.get('SYSTEMML_RELEASE', version)
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = 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 = 'classic'
+
+# 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 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']
+
+# Custom sidebar templates, must be a dictionary that maps document names
+# to template names.
+#
+# html_sidebars = {}
+
+# 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
+
+# If false, no module index is generated.
+# html_domain_indices = True
+
+# If false, no index is generated.
+# html_use_index = True
+
+# If true, links to the .rst sources are added to the pages.
+html_show_sourcelink = False
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+html_logo = "../../../docs/img/systemml-logo.png"
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.
+html_favicon = "../../../docs/img/favicon.png"
+
+# 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
+
+# -- Options for HTMLHelp output ------------------------------------------
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'SystemMLdoc'
+
+
+# -- Options for LaTeX output ---------------------------------------------
+
+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': '',
+
+    # 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, 'SystemML.tex', u'SystemML Documentation',
+     u'None', 'manual'),
+]
+
+
+# -- 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, 'systemml', u'SystemML Documentation',
+     [author], 1)
+]
+
+
+# -- 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, 'SystemML', u'SystemML Documentation',
+     author, 'SystemML', 'One line description of project.',
+     'Miscellaneous'),
+]
+
+
+

http://git-wip-us.apache.org/repos/asf/systemml/blob/c249c6fd/src/main/pythondoc/index.rst
----------------------------------------------------------------------
diff --git a/src/main/pythondoc/index.rst b/src/main/pythondoc/index.rst
new file mode 100644
index 0000000..684708d
--- /dev/null
+++ b/src/main/pythondoc/index.rst
@@ -0,0 +1,21 @@
+.. SystemML documentation master file, created by
+   sphinx-quickstart on Thu Aug 24 11:58:36 2017.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+SystemML Python API
+===================
+
+.. toctree::
+   :maxdepth: 4
+   :caption: Contents:
+
+   systemml
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`

http://git-wip-us.apache.org/repos/asf/systemml/blob/c249c6fd/src/main/pythondoc/make.bat
----------------------------------------------------------------------
diff --git a/src/main/pythondoc/make.bat b/src/main/pythondoc/make.bat
new file mode 100644
index 0000000..e875e2d
--- /dev/null
+++ b/src/main/pythondoc/make.bat
@@ -0,0 +1,57 @@
+::-------------------------------------------------------------
+::
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+:: 
+::   http://www.apache.org/licenses/LICENSE-2.0
+:: 
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+::
+::-------------------------------------------------------------
+
+@ECHO OFF
+
+pushd %~dp0
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+       set SPHINXBUILD=python -msphinx
+)
+set SOURCEDIR=.
+set BUILDDIR=..\..\..\target\pydocs
+set SPHINXPROJ=SystemML
+
+if "%1" == "" goto help
+
+%SPHINXBUILD% >NUL 2>NUL
+if errorlevel 9009 (
+       echo.
+       echo.The Sphinx module was not found. Make sure you have Sphinx 
installed,
+       echo.then set the SPHINXBUILD environment variable to point to the full
+       echo.path of the 'sphinx-build' executable. Alternatively you may add 
the
+       echo.Sphinx directory to PATH.
+       echo.
+       echo.If you don't have Sphinx installed, grab it from
+       echo.http://sphinx-doc.org/
+       exit /b 1
+)
+
+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
+goto end
+
+:help
+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
+
+:end
+popd

http://git-wip-us.apache.org/repos/asf/systemml/blob/c249c6fd/src/main/pythondoc/systemml.mllearn.rst
----------------------------------------------------------------------
diff --git a/src/main/pythondoc/systemml.mllearn.rst 
b/src/main/pythondoc/systemml.mllearn.rst
new file mode 100644
index 0000000..e8b018c
--- /dev/null
+++ b/src/main/pythondoc/systemml.mllearn.rst
@@ -0,0 +1,22 @@
+systemml\.mllearn package
+=========================
+
+Submodules
+----------
+
+systemml\.mllearn\.estimators module
+------------------------------------
+
+.. automodule:: systemml.mllearn.estimators
+    :members:
+    :undoc-members:
+    :show-inheritance:
+
+
+Module contents
+---------------
+
+.. automodule:: systemml.mllearn
+    :members:
+    :undoc-members:
+    :show-inheritance:

http://git-wip-us.apache.org/repos/asf/systemml/blob/c249c6fd/src/main/pythondoc/systemml.random.rst
----------------------------------------------------------------------
diff --git a/src/main/pythondoc/systemml.random.rst 
b/src/main/pythondoc/systemml.random.rst
new file mode 100644
index 0000000..d93fb54
--- /dev/null
+++ b/src/main/pythondoc/systemml.random.rst
@@ -0,0 +1,22 @@
+systemml\.random package
+========================
+
+Submodules
+----------
+
+systemml\.random\.sampling module
+---------------------------------
+
+.. automodule:: systemml.random.sampling
+    :members:
+    :undoc-members:
+    :show-inheritance:
+
+
+Module contents
+---------------
+
+.. automodule:: systemml.random
+    :members:
+    :undoc-members:
+    :show-inheritance:

http://git-wip-us.apache.org/repos/asf/systemml/blob/c249c6fd/src/main/pythondoc/systemml.rst
----------------------------------------------------------------------
diff --git a/src/main/pythondoc/systemml.rst b/src/main/pythondoc/systemml.rst
new file mode 100644
index 0000000..f7f6044
--- /dev/null
+++ b/src/main/pythondoc/systemml.rst
@@ -0,0 +1,54 @@
+systemml package
+================
+
+Subpackages
+-----------
+
+.. toctree::
+
+    systemml.mllearn
+    systemml.random
+
+Submodules
+----------
+
+systemml\.classloader module
+----------------------------
+
+.. automodule:: systemml.classloader
+    :members:
+    :undoc-members:
+    :show-inheritance:
+
+systemml\.converters module
+---------------------------
+
+.. automodule:: systemml.converters
+    :members:
+    :undoc-members:
+    :show-inheritance:
+
+systemml\.defmatrix module
+--------------------------
+
+.. automodule:: systemml.defmatrix
+    :members:
+    :undoc-members:
+    :show-inheritance:
+
+systemml\.mlcontext module
+--------------------------
+
+.. automodule:: systemml.mlcontext
+    :members:
+    :undoc-members:
+    :show-inheritance:
+
+
+Module contents
+---------------
+
+.. automodule:: systemml
+    :members:
+    :undoc-members:
+    :show-inheritance:

Reply via email to