Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
#
import os
import sys
from datetime import date
sys.path.insert(0, os.path.abspath('..'))


# -- Project information -----------------------------------------------------

project = 'dpdata'
copyright = '2019, Han Wang'
copyright = '2019-%d, Deep Modeling ' % date.today().year
author = 'Han Wang'

# The short X.Y version
Expand All @@ -39,11 +40,12 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinxcontrib.napoleon',
'sphinx_rtd_theme',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'm2r',
'sphinx.ext.intersphinx',
'numpydoc',
'm2r2',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -79,7 +81,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
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
Expand All @@ -90,7 +92,7 @@
# 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']
#html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down Expand Up @@ -161,3 +163,18 @@


# -- Extension configuration -------------------------------------------------
def run_apidoc(_):
from sphinx.ext.apidoc import main
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
cur_dir = os.path.abspath(os.path.dirname(__file__))
module = os.path.join(cur_dir, "..", "dpdata")
main(['-M', '--tocfile', 'api', '-H', 'API documentation', '-o', os.path.join(cur_dir, "api"), module, '--force'])

def setup(app):
app.connect('builder-inited', run_apidoc)


intersphinx_mapping = {
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
"python": ("https://docs.python.org/", None),
}
13 changes: 1 addition & 12 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,11 @@ Welcome to dpdata's documentation!
:maxdepth: 2
:caption: Contents:

api/api

.. mdinclude:: ../README.md


API documentation
=================

.. automodule:: dpdata

.. autoclass:: System
:members: __init__, __getitem__, get_nframes, get_natoms, sub_system, append, apply_pbc, to_lammps_lmp, to_vasp_poscar

.. autoclass:: LabeledSystem
:members: __init__, sub_system, to_deepmd_raw, to_deepmd_npy


Indices and tables
==================

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.[docs]
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
'ase': ['ase'],
'amber': ['parmed'],
'pymatgen': ['pymatgen'],
'docs': ['sphinx', 'recommonmark', 'sphinx_rtd_theme>=1.0.0rc1', 'numpydoc', 'm2r2'],
}
)