Skip to content

Commit c97e016

Browse files
committed
start work on docs
1 parent 85b3a35 commit c97e016

34 files changed

+1239
-355
lines changed

.flake8

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
2-
ignore = E731, W503, W504, E203
2+
ignore = E731, W503, W504, E203, W605
33
max-line-length=80
44
exclude = .git,__pycache__,*__init__.py,alnur

doc/Makefile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
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)
21+
@if [ "$@" = "html" ]; then \
22+
touch $(BUILDDIR)/html/.nojekyll; \
23+
fi

doc/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

doc/source/.conf.py.swp

12 KB
Binary file not shown.

doc/source/.index.rst.swp

16 KB
Binary file not shown.
12 KB
Binary file not shown.

doc/source/_static/css/custom.css

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap');
2+
3+
:root {
4+
--sidebarcolor: #102133;
5+
--sidebarfontcolor: #ffffff;
6+
--sidebarhover: #295e97;
7+
8+
--bodyfontcolor: #333;
9+
--webfont: 'Raleway';
10+
11+
--contentwidth: 1000px;
12+
}
13+
14+
/* Fonts and text */
15+
h1, h2, h3, h4, h5, h6 {
16+
font-family: var(--webfont), 'Helvetica Neue', Helvetica, Arial, sans-serif;
17+
font-weight: 400;
18+
}
19+
20+
h1 {
21+
font-size: 225%;
22+
}
23+
24+
body {
25+
font-family: var(--webfont), 'Helvetica Neue', Helvetica, Arial, sans-serif;
26+
color: var(--bodyfontcolor);
27+
}
28+
29+
p {
30+
font-size: 1em;
31+
line-height: 150%;
32+
}
33+
34+
35+
/* Sidebar */
36+
.wy-side-nav-search {
37+
background-color: var(--sidebarcolor);
38+
}
39+
40+
.wy-nav-side {
41+
background: var(--sidebarcolor);
42+
}
43+
44+
.wy-menu-vertical header, .wy-menu-vertical p.caption {
45+
color: var(--sidebarfontcolor);
46+
}
47+
48+
.wy-menu-vertical a {
49+
color: var(--sidebarfontcolor);
50+
}
51+
52+
.wy-menu-vertical a:hover {
53+
background-color: var(--sidebarhover);
54+
}
55+
56+
/* Main content */
57+
.wy-nav-content {
58+
max-width: var(--contentwidth);
59+
}

doc/source/api/index.rst

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
.. _api:
2+
3+
API
4+
===
5+
6+
MDE
7+
~~~
8+
9+
.. autoclass:: pymde.MDE
10+
:members:
11+
:exclude-members: forward
12+
13+
.. automethod:: __init__
14+
15+
.. autofunction:: pymde.preserve_neighbors
16+
17+
.. autofunction:: pymde.preserve_distances
18+
19+
Distortion functions
20+
~~~~~~~~~~~~~~~~~~~~
21+
22+
Penalties
23+
^^^^^^^^^
24+
25+
.. automodule:: pymde.penalties
26+
27+
.. autoclass:: pymde.penalties.Linear
28+
:exclude-members: forward
29+
30+
.. autoclass:: pymde.penalties.Quadratic
31+
:exclude-members: forward
32+
33+
.. autoclass:: pymde.penalties.Cubic
34+
:exclude-members: forward
35+
36+
.. autoclass:: pymde.penalties.Power
37+
:exclude-members: forward
38+
39+
.. autoclass:: pymde.penalties.Huber
40+
:exclude-members: forward
41+
42+
.. autoclass:: pymde.penalties.Logistic
43+
:exclude-members: forward
44+
45+
.. autoclass:: pymde.penalties.Log1p
46+
:exclude-members: forward
47+
48+
.. autoclass:: pymde.penalties.Log
49+
:exclude-members: forward
50+
51+
.. autoclass:: pymde.penalties.InvPower
52+
:exclude-members: forward
53+
54+
.. autoclass:: pymde.penalties.LogRatio
55+
:exclude-members: forward
56+
57+
.. autoclass:: pymde.penalties.PushAndPull
58+
:exclude-members: forward
59+
60+
Losses
61+
^^^^^^^^^
62+
63+
.. automodule:: pymde.losses
64+
65+
.. autoclass:: pymde.losses.Absolute
66+
:exclude-members: forward
67+
68+
.. autoclass:: pymde.losses.Quadratic
69+
:exclude-members: forward
70+
71+
.. autoclass:: pymde.losses.Cubic
72+
:exclude-members: forward
73+
74+
.. autoclass:: pymde.losses.Power
75+
:exclude-members: forward
76+
77+
.. autoclass:: pymde.losses.WeightedQuadratic
78+
:exclude-members: forward
79+
80+
.. autoclass:: pymde.losses.Fractional
81+
:exclude-members: forward
82+
83+
.. autoclass:: pymde.losses.SoftFractional
84+
:exclude-members: forward
85+
86+
Constraints
87+
~~~~~~~~~~~
88+
89+
.. autoclass:: pymde.constraints.Constraint
90+
:members:
91+
92+
.. autofunction:: pymde.Centered
93+
94+
.. autofunction:: pymde.Standardized
95+
96+
.. autoclass:: pymde.Anchored
97+
98+
.. automethod:: __init__
99+
100+
101+
Preprocessing
102+
~~~~~~~~~~~~~
103+
104+
.. autoclass:: pymde.Graph
105+
:members:
106+
107+
.. autofunction:: pymde.preprocess.graph.k_nearest_neighbors
108+
109+
.. autofunction:: pymde.preprocess.graph.shortest_paths
110+
111+
.. autofunction:: pymde.preprocess.data_matrix.k_nearest_neighbors
112+
113+
Utilities
114+
~~~~~~~~~
115+
116+
.. autofunction:: pymde.all_edges
117+
118+
.. autofunction:: pymde.align
119+
120+
.. autofunction:: pymde.center
121+
122+
.. autofunction:: pymde.rotate
123+
124+
.. autofunction:: pymde.plot

doc/source/citing/.index.rst.swp

12 KB
Binary file not shown.

doc/source/citing/index.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. _citing:
2+
3+
Citing
4+
======
5+
6+
If you use PyMDE in academic work, please consider citing the paper it
7+
accompanies (*Minimum-Distortion Embedding*.) You can use the following
8+
BibTex entry:
9+
10+
.. code:: bibtex
11+
12+
@article{agrawal2020minimum,
13+
author = {Agrawal, Akshay and Ali, Alnur and Boyd, Stephen},
14+
title = {Minimum-Distortion Embedding},
15+
url = {https://web.stanford.edu/~boyd/papers/min_dist_emb.html},
16+
year = {2020},
17+
}
18+
19+
If you want to keep tabs on the development of PyMDE (or just want to send
20+
a virtual kudos), consider leaving a star on the
21+
`Github repository <https://github.com/cvxgrp/pymde>`_.

doc/source/conf.py

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'pymde'
21+
copyright = '2021, Akshay Agrawal'
22+
author = 'Akshay Agrawal'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '0.1.0'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = [
34+
'sphinx_rtd_theme',
35+
'sphinx.ext.autodoc',
36+
'sphinx.ext.napoleon',
37+
]
38+
39+
# The name of the Pygments (syntax highlighting) style to use.
40+
pygments_style = 'autumn'
41+
42+
# Add any paths that contain templates here, relative to this directory.
43+
templates_path = ['_templates']
44+
45+
# List of patterns, relative to source directory, that match files and
46+
# directories to ignore when looking for source files.
47+
# This pattern also affects html_static_path and html_extra_path.
48+
exclude_patterns = []
49+
50+
51+
# -- Options for HTML output -------------------------------------------------
52+
53+
# The theme to use for HTML and HTML Help pages. See the documentation for
54+
# a list of builtin themes.
55+
#
56+
html_theme = 'sphinx_rtd_theme'
57+
58+
# Add any paths that contain custom static files (such as style sheets) here,
59+
# relative to this directory. They are copied after the builtin static files,
60+
# so a file named "default.css" will overwrite the builtin "default.css".
61+
html_static_path = ['_static']
62+
63+
html_css_files = [
64+
'css/custom.css',
65+
]

doc/source/datasets/index.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. _datasets:
2+
3+
Datasets
4+
========
5+

0 commit comments

Comments
 (0)