Skip to content

Commit f04f19a

Browse files
committed
Add the docs
1 parent 0cce9f4 commit f04f19a

File tree

10 files changed

+341
-2
lines changed

10 files changed

+341
-2
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*.so
99
*.pyc
1010
.classpath
11+
*build
1112

1213
# Packages #
1314
############
@@ -54,5 +55,4 @@ Thumbs.db
5455
/data
5556
example_scripts/example_output/
5657
*/tmp/*
57-
venv
58-
docs
58+
venv

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS = "-W" # This flag turns warnings into errors.
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = PackagingScientificPython
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
set SPHINXPROJ=PackagingScientificPython
13+
14+
if "%1" == "" goto help
15+
16+
%SPHINXBUILD% >NUL 2>NUL
17+
if errorlevel 9009 (
18+
echo.
19+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
20+
echo.installed, then set the SPHINXBUILD environment variable to point
21+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
22+
echo.may add the Sphinx directory to PATH.
23+
echo.
24+
echo.If you don't have Sphinx installed, grab it from
25+
echo.http://sphinx-doc.org/
26+
exit /b 1
27+
)
28+
29+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30+
goto end
31+
32+
:help
33+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34+
35+
:end
36+
popd

docs/source/_static/.placeholder

Whitespace-only changes.

docs/source/conf.py

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# constrained-matrix-factorization documentation build configuration file, created by
5+
# sphinx-quickstart on Thu Jun 28 12:35:56 2018.
6+
#
7+
# This file is execfile()d with the current directory set to its
8+
# containing dir.
9+
#
10+
# Note that not all possible configuration values are present in this
11+
# autogenerated file.
12+
#
13+
# All configuration values have a default; values that are commented out
14+
# serve to show the default.
15+
16+
# If extensions (or modules to document with autodoc) are in another directory,
17+
# add these directories to sys.path here. If the directory is relative to the
18+
# documentation root, use os.path.abspath to make it absolute, like shown here.
19+
#
20+
# import os
21+
# import sys
22+
# sys.path.insert(0, os.path.abspath('.'))
23+
24+
25+
# -- General configuration ------------------------------------------------
26+
27+
# If your documentation needs a minimal Sphinx version, state it here.
28+
#
29+
# needs_sphinx = '1.0'
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = [
35+
"sphinx.ext.autodoc",
36+
"sphinx.ext.autosummary",
37+
"sphinx.ext.githubpages",
38+
"sphinx.ext.intersphinx",
39+
"sphinx.ext.mathjax",
40+
"sphinx.ext.viewcode",
41+
"IPython.sphinxext.ipython_directive",
42+
"IPython.sphinxext.ipython_console_highlighting",
43+
"matplotlib.sphinxext.plot_directive",
44+
"numpydoc",
45+
"sphinx_copybutton",
46+
]
47+
48+
# Configuration options for plot_directive. See:
49+
# https://github.com/matplotlib/matplotlib/blob/f3ed922d935751e08494e5fb5311d3050a3b637b/lib/matplotlib/sphinxext/plot_directive.py#L81
50+
plot_html_show_source_link = False
51+
plot_html_show_formats = False
52+
53+
# Generate the API documentation when building
54+
autosummary_generate = True
55+
numpydoc_show_class_members = False
56+
57+
# Add any paths that contain templates here, relative to this directory.
58+
templates_path = ["_templates"]
59+
60+
# The suffix(es) of source filenames.
61+
# You can specify multiple suffix as a list of string:
62+
#
63+
# source_suffix = ['.rst', '.md']
64+
source_suffix = ".rst"
65+
66+
# The master toctree document.
67+
master_doc = "index"
68+
69+
# General information about the project.
70+
project = "constrained-matrix-factorization"
71+
copyright = "2021, Phil Maffettone"
72+
author = "Phil Maffettone"
73+
74+
# The version info for the project you're documenting, acts as replacement for
75+
# |version| and |release|, also used in various other places throughout the
76+
# built documents.
77+
#
78+
import constrainedmf
79+
80+
# The short X.Y version.
81+
version = constrainedmf.__version__
82+
# The full version, including alpha/beta/rc tags.
83+
release = constrainedmf.__version__
84+
85+
# The language for content autogenerated by Sphinx. Refer to documentation
86+
# for a list of supported languages.
87+
#
88+
# This is also used if you do content translation via gettext catalogs.
89+
# Usually you set "language" from the command line for these cases.
90+
language = None
91+
92+
# List of patterns, relative to source directory, that match files and
93+
# directories to ignore when looking for source files.
94+
# This patterns also effect to html_static_path and html_extra_path
95+
exclude_patterns = []
96+
97+
# The name of the Pygments (syntax highlighting) style to use.
98+
pygments_style = "sphinx"
99+
100+
# If true, `todo` and `todoList` produce output, else they produce nothing.
101+
todo_include_todos = False
102+
103+
104+
# -- Options for HTML output ----------------------------------------------
105+
106+
# The theme to use for HTML and HTML Help pages. See the documentation for
107+
# a list of builtin themes.
108+
#
109+
html_theme = "sphinx_rtd_theme"
110+
import sphinx_rtd_theme
111+
112+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
113+
114+
# Theme options are theme-specific and customize the look and feel of a theme
115+
# further. For a list of options available for each theme, see the
116+
# documentation.
117+
#
118+
# html_theme_options = {}
119+
120+
# Add any paths that contain custom static files (such as style sheets) here,
121+
# relative to this directory. They are copied after the builtin static files,
122+
# so a file named "default.css" will overwrite the builtin "default.css".
123+
html_static_path = ["_static"]
124+
125+
# Custom sidebar templates, must be a dictionary that maps document names
126+
# to template names.
127+
#
128+
# This is required for the alabaster theme
129+
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
130+
html_sidebars = {
131+
"**": [
132+
"relations.html", # needs 'show_related': True theme option to display
133+
"searchbox.html",
134+
]
135+
}
136+
137+
138+
# -- Options for HTMLHelp output ------------------------------------------
139+
140+
# Output file base name for HTML help builder.
141+
htmlhelp_basename = "constrainedmf"
142+
143+
144+
# -- Options for LaTeX output ---------------------------------------------
145+
146+
latex_elements = {
147+
# The paper size ('letterpaper' or 'a4paper').
148+
#
149+
# 'papersize': 'letterpaper',
150+
# The font size ('10pt', '11pt' or '12pt').
151+
#
152+
# 'pointsize': '10pt',
153+
# Additional stuff for the LaTeX preamble.
154+
#
155+
# 'preamble': '',
156+
# Latex figure (float) alignment
157+
#
158+
# 'figure_align': 'htbp',
159+
}
160+
161+
# Grouping the document tree into LaTeX files. List of tuples
162+
# (source start file, target name, title,
163+
# author, documentclass [howto, manual, or own class]).
164+
latex_documents = [
165+
(
166+
master_doc,
167+
"constrainedmf.tex",
168+
"constrained-matrix-factorization Documentation",
169+
"Contributors",
170+
"manual",
171+
),
172+
]
173+
174+
175+
# -- Options for manual page output ---------------------------------------
176+
177+
# One entry per manual page. List of tuples
178+
# (source start file, name, description, authors, manual section).
179+
man_pages = [
180+
(
181+
master_doc,
182+
"constrainedmf",
183+
"constrained-matrix-factorization Documentation",
184+
[author],
185+
1,
186+
)
187+
]
188+
189+
190+
# -- Options for Texinfo output -------------------------------------------
191+
192+
# Grouping the document tree into Texinfo files. List of tuples
193+
# (source start file, target name, title, author,
194+
# dir menu entry, description, category)
195+
texinfo_documents = [
196+
(
197+
master_doc,
198+
"constrainedmf",
199+
"constrained-matrix-factorization Documentation",
200+
author,
201+
"constrainedmf",
202+
"Advancements on non-negative matrix factorization in PyTorch, with crystallography as a primary use case.",
203+
"Miscellaneous",
204+
),
205+
]
206+
207+
208+
# Example configuration for intersphinx: refer to the Python standard library.
209+
intersphinx_mapping = {
210+
"python": ("https://docs.python.org/3/", None),
211+
"numpy": ("https://numpy.org/doc/stable/", None),
212+
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
213+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
214+
"matplotlib": ("https://matplotlib.org/stable", None),
215+
}

docs/source/index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. Packaging Scientific Python documentation master file, created by
2+
sphinx-quickstart on Thu Jun 28 12:35:56 2018.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
constrained-matrix-factorization Documentation
7+
==============================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
12+
installation
13+
usage
14+
release-history
15+
min_versions

docs/source/installation.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
============
2+
Installation
3+
============
4+
5+
At the command line::
6+
7+
$ pip install constrainedmf

docs/source/min_versions.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
===================================
2+
Minimum Version of Python and NumPy
3+
===================================
4+
5+
6+
- This project supports at least the minor versions of Python
7+
initially released 42 months prior to a planned project release
8+
date.
9+
- The project will always support at least the 2 latest minor
10+
versions of Python.
11+
- The project will support minor versions of ``numpy`` initially
12+
released in the 24 months prior to a planned project release date or
13+
the oldest version that supports the minimum Python version
14+
(whichever is higher).
15+
- The project will always support at least the 3 latest minor
16+
versions of NumPy.
17+
18+
The minimum supported version of Python will be set to
19+
``python_requires`` in ``setup``. All supported minor versions of
20+
Python will be in the test matrix and have binary artifacts built
21+
for releases.
22+
23+
The project should adjust upward the minimum Python and NumPy
24+
version support on every minor and major release, but never on a
25+
patch release.
26+
27+
This is consistent with NumPy `NEP 29
28+
<https://numpy.org/neps/nep-0029-deprecation_policy.html>`__.

docs/source/release-history.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
===============
2+
Release History
3+
===============
4+
5+
v0.1.0 (2021-11-01)
6+
----------------------------
7+
This initial release marks the transfer of this repository to the NSLS-II organization.
8+
Initial publication details can be found on `the arXiv <https://arxiv.org/abs/2104.00864>`_,
9+
with the peer reviewed version accepted for publication in Applied Physics Reviews.

docs/source/usage.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=====
2+
Usage
3+
=====
4+
5+
Start by importing constrained-matrix-factorization.
6+
7+
.. code-block:: python
8+
9+
import constrainedmf

0 commit comments

Comments
 (0)