Skip to content

Commit 8b668cd

Browse files
msmdevmichalk8
andauthored
Add application example to example.ipynb (#12)
* Added application example to example.ipynb * Add __str__, __repr__, fix some .md * Try add Binder * [ci skip] Fix binder link * Stylize docs * [ci skip] Skip trailing WS in .bump2version * [ci skip] D-orthogonal warning verbosity, mu=100 * Add extra Copyright note in _util.py docstrings. * Update example.ipynb with toy matrix provided by Marius. * Change dtype to np.complex64 * Fix sphinx warnings * Do not fail RTD on warnings * [ci skip] Add spellcheck, fix typos * [ci skip] Fix css, update classifier and doc * Specify credits to MSMTools. * Add key contributors to RTD. Co-authored-by: michalk8 <michal.klein@protonmail.com>
1 parent c9d32e3 commit 8b668cd

21 files changed

Lines changed: 515 additions & 33 deletions

.bumpversion.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ commit = True
44
tag = True
55
files = setup.py pygpcca/__init__.py
66
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
7-
serialize =
8-
{major}.{minor}.{patch}
7+
serialize = {major}.{minor}.{patch}

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ repos:
4848
- id: mixed-line-ending
4949
args: [--fix=lf]
5050
- id: trailing-whitespace
51+
exclude: ^.bumpversion.cfg$ # trailing whitespace
5152
- id: name-tests-test
5253
args: [--django]
5354
- id: check-case-conflict

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
sphinx:
44
builder: html
55
configuration: docs/source/conf.py
6-
fail_on_warning: true
6+
fail_on_warning: false
77

88
formats:
99
- htmlzip

README.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ pyGPCCA - Generalized Perron Cluster Cluster Analysis
55
Generalized Perron Cluster Cluster Analysis program to coarse-grain reversible and non-reversible Markov State Models.
66

77
Markov State Models (MSM) enable the identification and analysis of metastable states and related kinetics in a
8-
very instructive manner. They are widely used, e.g. to model molecular or cellular kinetics.
8+
very instructive manner. They are widely used, e.g. to model molecular or cellular kinetics. |br|
99
Common state-of-the-art Markov state modeling methods and tools are very well suited to model reversible processes in
1010
closed equilibrium systems. However, most are not well suited to deal with non-reversible or even non-autonomous
11-
processes of non-equilibrium systems.
11+
processes of non-equilibrium systems. |br|
1212
To overcome this limitation, the Generalized Robust Perron Cluster Cluster Analysis (G-PCCA) was developed.
1313
The G-PCCA method implemented in the *pyGPCCA* program readily handles equilibrium as well as non-equilibrium data by
14-
utilizing real Schur vectors instead of eigenvectors.
14+
utilizing real Schur vectors instead of eigenvectors. |br|
1515
*pyGPCCA* enables the semiautomatic coarse-graining of transition matrices representing the dynamics of the system
1616
under study. Utilizing *pyGPCCA*, metastable states as well as cyclic kinetics can be identified and modeled.
1717

@@ -43,7 +43,7 @@ Example
4343
Please refer to our `example usage <https://pygpcca.readthedocs.io/en/latest/example.html>`_ in the documentation.
4444

4545
.. |PyPI| image:: https://img.shields.io/pypi/v/pygpcca
46-
:target: https://pypi.org/project/pygpcca
46+
:target: https://pypi.org/project/pygpcca/
4747
:alt: PyPI
4848

4949
.. |Conda| image:: https://img.shields.io/conda/vn/conda-forge/pygpcca
@@ -68,3 +68,7 @@ Please refer to our `example usage <https://pygpcca.readthedocs.io/en/latest/exa
6868

6969
.. _`PETSc`: https://www.mcs.anl.gov/petsc/
7070
.. _`SLEPc`: https://slepc.upv.es/
71+
72+
.. |br| raw:: html
73+
74+
<br/>

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ nbsphinx>=0.7
33
sphinx>=3.3.0
44
sphinx-autodoc-annotation
55
sphinx-autodoc-typehints>=1.10.3
6+
sphinx-copybutton
67
sphinx_last_updated_by_git
78
sphinx_rtd_theme
9+
sphinxcontrib-spelling

docs/source/_key_contributors.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.. sidebar:: Key Contributors
2+
:subtitle: `pyGPCCA graph`_ | ☀ = maintainer
3+
4+
* `Bernhard Reuter`_: lead developer ☀
5+
* `Michal Klein`_: developer, diverse contributions
6+
* `Marius Lange`_: developer, diverse contributions
7+
8+
.. _pyGPCCA graph: https://github.com/msmdev/pyGPCCA/graphs/contributors
9+
.. _Bernhard Reuter: https://github.com/msmdev
10+
.. _Michal Klein: https://github.com/michalk8
11+
.. _Marius Lange: https://github.com/Marius1311

docs/source/_static/.gitkeep

Whitespace-only changes.

docs/source/_static/css/custom.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.wy-nav-content {
2+
max-width: 1000px;
3+
}
4+
5+
.wy-side-nav-search {
6+
background-color: #2961b9;
7+
}
8+
9+
.wy-side-nav-search input[type="text"] {
10+
border-radius: 6px!important;
11+
}
12+
13+
.highlight {
14+
background: #f6f5f9;
15+
}
16+
17+
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) > dt {
18+
color: #404040;
19+
background-color: #90b2ff45;
20+
border-top: solid 4px #2932b9c4;
21+
}
22+
23+
.rst-content code.literal {
24+
color: #404040;
25+
font-weight: 700;
26+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# TODO: once this is on PyPI, use PyPI version
2+
git+https://github.com/msmdev/pyGPCCA
3+
matplotlib

docs/source/conf.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
# list see the documentation:
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

7-
from typing import List
87
from pathlib import Path
98
from datetime import datetime
109
import os
1110

1211
# -- Path setup --------------------------------------------------------------
1312
import sys
1413

14+
from sphinx.application import Sphinx
15+
1516
HERE = Path(__file__).parent
1617
sys.path.insert(0, str(HERE.parent.parent))
1718
sys.path.insert(0, os.path.abspath("_ext"))
@@ -21,13 +22,14 @@
2122
needs_sphinx = "3.3"
2223
# -- Project information -----------------------------------------------------
2324

24-
project = "pygpcca"
25+
project = "pyGPCCA"
2526
author = pygpcca.__author__
2627
copyright = f"{datetime.now():%Y}, {author}" # noqa: A001
2728

2829
# The full version, including alpha/beta/rc tags
2930
master_doc = "index"
30-
release = "0.0.0"
31+
release = "main"
32+
version = f"main ({pygpcca.__version__})"
3133

3234

3335
# -- General configuration ---------------------------------------------------
@@ -44,6 +46,7 @@
4446
"sphinx.ext.mathjax",
4547
"sphinx_autodoc_typehints",
4648
"sphinx_last_updated_by_git",
49+
"sphinx_copybutton",
4750
"typed_returns",
4851
"nbsphinx",
4952
]
@@ -59,7 +62,7 @@
5962
# List of patterns, relative to source directory, that match files and
6063
# directories to ignore when looking for source files.
6164
# This pattern also affects html_static_path and html_extra_path.
62-
exclude_patterns: List[str] = []
65+
exclude_patterns = ["build", "**.ipynb_checkpoints"]
6366

6467
source_suffix = ".rst"
6568
add_function_parentheses = True
@@ -84,6 +87,32 @@
8487
napoleon_use_admonition_for_references = False
8588
todo_include_todos = False
8689

90+
# binder
91+
nbsphinx_highlight_language = "python3"
92+
nbsphinx_execute_arguments = [
93+
"--InlineBackend.figure_formats={'png', 'pdf'}", # correct figure resize
94+
"--InlineBackend.rc={'figure.dpi': 96}",
95+
]
96+
nbsphinx_prolog = r"""
97+
{% set docname = 'docs/source/' + env.doc2path(env.docname, base=None) %}
98+
.. raw:: html
99+
100+
<div class="note">
101+
Interactive version
102+
<a href="https://mybinder.org/v2/gh/msmdev/pygpcca/{{ env.config.release|e }}?filepath={{ docname|e }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom">
103+
</a>
104+
</div>
105+
""" # noqa: E501
106+
107+
# spelling
108+
spelling_lang = "en_US"
109+
spelling_warning = True
110+
spelling_word_list_filename = "spelling_wordlist.txt"
111+
spelling_add_pypi_package_names = True
112+
spelling_show_suggestions = True
113+
# see: https://pyenchant.github.io/pyenchant/api/enchant.tokenize.html
114+
spelling_filters = ["enchant.tokenize.URLFilter", "enchant.tokenize.EmailFilter"]
115+
87116
# Add any paths that contain custom static files (such as style sheets) here,
88117
# relative to this directory. They are copied after the builtin static files,
89118
# so a file named "default.css" will overwrite the builtin "default.css".
@@ -93,3 +122,7 @@
93122
html_show_sphinx = False
94123
html_use_smartypants = True
95124
pygments_style = "sphinx"
125+
126+
127+
def setup(app: Sphinx) -> None:
128+
app.add_css_file("css/custom.css")

0 commit comments

Comments
 (0)