Skip to content

Commit

Permalink
Merge pull request #43 from choderalab/add-docs
Browse files Browse the repository at this point in the history
Add docs
  • Loading branch information
hmacdope authored Feb 5, 2024
2 parents b33838a + eb696ff commit 025827b
Show file tree
Hide file tree
Showing 12 changed files with 177 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ instance/

# Sphinx documentation
docs/_build/
docs/_autosummary/


# PyBuilder
target/
Expand Down
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# readthedocs.yml

version: 2

build:
os: ubuntu-22.04
tools:
python: "mambaforge-22.9"

sphinx:
configuration: docs/conf.py

conda:
environment: docs/requirements.yaml

python:
# Install our python package before building the docs
install:
- method: pip
path: .
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MTENN
[//]: # (Badges)
[![GitHub Actions Build Status](https://github.com/choderalab/mtenn/workflows/CI/badge.svg)](https://github.com/REPLACE_WITH_OWNER_ACCOUNT/mtenn/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/choderalab/mtenn/branch/master/graph/badge.svg)](https://codecov.io/gh/REPLACE_WITH_OWNER_ACCOUNT/MTENN/branch/master)

[![Documentation Status](https://readthedocs.org/projects/mtenn/badge/?version=latest)](https://mtenn.readthedocs.io/en/latest/?badge=latest)

Modular Training and Evaluation of Neural Networks

Expand Down
9 changes: 5 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXPROJ = mtenn
SOURCEDIR = .
BUILDDIR = _build
Expand All @@ -17,4 +18,4 @@ help:
# 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)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
4 changes: 2 additions & 2 deletions docs/_templates/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Templates Doc Directory

Add any paths that contain templates here, relative to
Add any paths that contain templates here, relative to
the `conf.py` file's directory.
They are copied after the builtin template files,
so a file named "page.html" will overwrite the builtin "page.html".

The path to this folder is set in the Sphinx `conf.py` file in the line:
The path to this folder is set in the Sphinx `conf.py` file in the line:
```python
html_static_path = ['_templates']
```
Expand Down
32 changes: 32 additions & 0 deletions docs/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:show-inheritance:
:inherited-members:

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
66 changes: 66 additions & 0 deletions docs/_templates/custom-module-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

{% block attributes %}
{% if attributes %}
.. rubric:: Module Attributes

.. autosummary::
:toctree:
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

.. autosummary::
:toctree:
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
:toctree:
:template: custom-class-template.rst
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
:toctree:
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
:toctree:
:template: custom-module-template.rst
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
7 changes: 0 additions & 7 deletions docs/api.rst

This file was deleted.

32 changes: 21 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
Expand All @@ -23,12 +22,9 @@

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

project = "MTENN"
copyright = (
"2022, Benjamin Kaminow. Project structure based on the "
"Computational Molecular Science Python Cookiecutter version 1.6"
)
author = "Benjamin Kaminow"
project = "mtenn"
copyright = "2024, Chodera Lab"
author = "Chodera Lab"

# The short X.Y version
version = ""
Expand Down Expand Up @@ -77,7 +73,7 @@
#
# 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
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -144,15 +140,29 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "mtenn.tex", "MTENN Documentation", "mtenn", "manual"),
(
master_doc,
"mtenn.tex",
"MTENN Documentation",
"mtenn",
"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, "mtenn", "MTENN Documentation", [author], 1)]
man_pages = [
(
master_doc,
"mtenn",
"MTENN Documentation",
[author],
1,
)
]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -167,7 +177,7 @@
"MTENN Documentation",
author,
"mtenn",
"Modular Training and Evaluation of Neural Networks",
"Modular Training and Evaluation of Neural Networks.",
"Miscellaneous",
),
]
Expand Down
15 changes: 11 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
.. mtenn documentation master file, created by
sphinx-quickstart on Thu Mar 15 13:55:56 2018.
sphinx-quickstart on Wed Jan 31 13:59:42 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to MTENN's documentation!
=========================================================
Welcome to mtenn's documentation!
=================================

.. toctree::
:maxdepth: 2
:caption: Contents:

getting_started
api


.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

mtenn



Expand Down
26 changes: 17 additions & 9 deletions docs/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
name: docs
name: mtenn
channels:
- conda-forge
dependencies:
# Base depends
- python
- pip



# Pip-only installs
#- pip:
- pytorch
- pytorch_geometric
- pytorch_cluster
- pytorch_scatter
- pytorch_sparse
- numpy
- h5py
- e3nn
- dgllife
- dgl
- rdkit
- ase

# docs
- sphinx
- sphinx_rtd_theme
15 changes: 0 additions & 15 deletions readthedocs.yml

This file was deleted.

0 comments on commit 025827b

Please sign in to comment.