From fe47516069ac70c504cef611a660020c49f2ab9c Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Wed, 9 Oct 2024 17:56:37 -0700 Subject: [PATCH 1/3] Update .readthedocs.yaml - fix #280 - use mambaforge installation --- .readthedocs.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index decf5fb8..31c7bb8d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,6 +5,11 @@ # Required version: 2 +build: + os: "ubuntu-22.04" + tools: + python: "mambaforge-22.9" + # Build documentation in the docs/ directory with Sphinx sphinx: configuration: doc/sphinx/source/conf.py @@ -13,8 +18,12 @@ sphinx: formats: - pdf -# Optionally set the version of Python and requirements required to build your docs +# install package python: - version: 3.8 install: - - requirements: doc/requirements.txt \ No newline at end of file + - method: pip + path: . + +conda: + environment: devtools/conda-envs/test_env.yaml + From b2a7d54ee27d80ad36df843119570cc01cefc00a Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Thu, 10 Oct 2024 11:31:12 -0700 Subject: [PATCH 2/3] RTD with own conda environment - new devtools/conda-envs/readthedocs.yaml - update RTD config with new env file - update sphinx config (intersphinx, put authors into variable) - blackened sphinx conf.py --- .readthedocs.yaml | 2 +- devtools/conda-envs/readthedocs.yaml | 26 +++++++++++++++++++++ doc/sphinx/source/conf.py | 34 +++++++++++++--------------- 3 files changed, 43 insertions(+), 19 deletions(-) create mode 100644 devtools/conda-envs/readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 31c7bb8d..4ee85489 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -25,5 +25,5 @@ python: path: . conda: - environment: devtools/conda-envs/test_env.yaml + environment: devtools/conda-envs/readthedocs.yaml diff --git a/devtools/conda-envs/readthedocs.yaml b/devtools/conda-envs/readthedocs.yaml new file mode 100644 index 00000000..a9d7747b --- /dev/null +++ b/devtools/conda-envs/readthedocs.yaml @@ -0,0 +1,26 @@ +name: readthedocs +channels: +- conda-forge +dependencies: +- python >=3.10 +- six +- numpy +- scipy >=1.11.0 +- matplotlib-base +- pandas +- scikit-learn +- pyyaml +- mdanalysis >=2 +- numkit +- gromacswrapper +- alchemlyb >=2 +- pymbar >=4 +- rdkit +- seaborn +- svgutils +- cairosvg +- pypdf + +# sphinx and RTD +- sphinx +- sphinx_rtd_theme \ No newline at end of file diff --git a/doc/sphinx/source/conf.py b/doc/sphinx/source/conf.py index b55c6df5..df741327 100644 --- a/doc/sphinx/source/conf.py +++ b/doc/sphinx/source/conf.py @@ -55,9 +55,8 @@ # General information about the project. project = "MDPOW" now = datetime.datetime.now() -copyright = "2010–{}, Shujie Fan, Ian Kenney, Alia Lescoulie, Bogdan Iorga, and Oliver Beckstein".format( - now.year -) +authors = "Shujie Fan, Ian Kenney, Alia Lescoulie, Bogdan Iorga, and Oliver Beckstein" +copyright = "2010–{}, ".format(now.year) + authors # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -220,16 +219,16 @@ latex_documents = [ ( "index", - "MDpow.tex", - "MDpow Documentation", - "Ian Kenney, Bogdan Iorga, and Oliver Beckstein", + "MDPOW.tex", + "MDPOW Documentation", + authors, "manual", ), ] # The name of an image file (relative to this directory) to place at the top of # the title page. -# latex_logo = None +latex_logo = html_logo # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. @@ -250,17 +249,16 @@ # intersphinx: reference standard lib and RecSQL # http://sphinx.pocoo.org/latest/ext/intersphinx.html intersphinx_mapping = { - "https://docs.python.org/": None, - "https://numpy.org/doc/stable/": None, - "https://docs.scipy.org/doc/scipy/reference/": None, - "https://gromacswrapper.readthedocs.io/en/latest": None, - "https://docs.mdanalysis.org/stable/": None, - "https://www.rdkit.org/docs/": None, - "https://pandas.pydata.org/docs/": None, - "https://seaborn.pydata.org": None, - "https://cairosvg.org/documentation/": None, - "https://svgutils.readthedocs.io/en/latest/": None, - "https://pypdf.readthedocs.io/en/stable/": None, + "python": ("https://docs.python.org/3", None), + "numpy": ("https://numpy.org/doc/stable/", None), + "scipy": ("https://docs.scipy.org/doc/scipy", None), + "GromacsWrapper": ("https://gromacswrapper.readthedocs.io/en/latest", None), + "MDAnalysis": ("https://docs.mdanalysis.org/stable/", None), + "RDKit": ("https://www.rdkit.org/docs/", None), + "pandas": ("https://pandas.pydata.org/docs/", None), + "seaborn": ("https://seaborn.pydata.org", None), + "svgutils": ("https://svgutils.readthedocs.io/en/latest/", None), + "pypdf": ("https://pypdf.readthedocs.io/en/stable/", None), } From 28ca1bdc118d2eab4d2105e8044ff04b1620e03a Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Thu, 10 Oct 2024 11:31:44 -0700 Subject: [PATCH 3/3] reST fixes in workflows/dihedrals.py --- mdpow/workflows/dihedrals.py | 38 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/mdpow/workflows/dihedrals.py b/mdpow/workflows/dihedrals.py index 05e678a9..050cbd10 100644 --- a/mdpow/workflows/dihedrals.py +++ b/mdpow/workflows/dihedrals.py @@ -511,10 +511,12 @@ def periodic_angle_padding(df, padding=45): def dihedral_violins(df, width=0.9, solvents=SOLVENTS_DEFAULT, plot_title=None): """Plots kernel density estimates (KDE) of dihedral angle frequencies for one dihedral atom group as violin plots, using as input the augmented - :class:`pandas.DataFrame` from :func:`~mdpow.workflows.dihedrals.periodic_angle_padding`. + :class:`pandas.DataFrame` from + :func:`~mdpow.workflows.dihedrals.periodic_angle_padding`. Output is converted to SVG by :func:`~mdpow.workflows.dihedrals.build_svg` - and final output is saved as PDF by :func:`~mdpow.workflows.dihedrals.plot_dihedral_violins` + and final output is saved as PDF by + :func:`~mdpow.workflows.dihedrals.plot_dihedral_violins` :keywords: @@ -523,13 +525,13 @@ def dihedral_violins(df, width=0.9, solvents=SOLVENTS_DEFAULT, plot_title=None): :func:`~mdpow.workflows.dihedrals.periodic_angle_padding` *width* - width of the violin element (>1 overlaps) - default: 0.9 + width of the violin element (>1 overlaps); default: 0.9 *solvents* The default solvents are documented under :data:`SOLVENTS_DEFAULT`. - Normally takes a two-tuple, but analysis is compatible with single solvent selections. - Single solvent analyses will result in a figure with fully filled violins for the single solvent. + Normally takes a two-tuple, but analysis is compatible with single + solvent selections. Single solvent analyses will result in a figure + with fully filled violins for the single solvent. *plot_title* generated by :func:`~mdpow.workflows.dihedrals.build_svg` using @@ -619,9 +621,8 @@ def build_svg( solvents=SOLVENTS_DEFAULT, width=0.9, ): - """Converts and combines figure components into an - SVG object to be converted and saved as a publication - quality PDF. + """Converts and combines figure components into an SVG object to be + converted and saved as a publication quality PDF. :keywords: @@ -629,14 +630,13 @@ def build_svg( :class:`rdkit.Chem.rdchem.Mol` object converted from `solute` *molname* - molecule name to be used for labelling - plots, if different from `resname` - (in this case, carried over from an upstream - decision between the two) + molecule name to be used for labelling plots, if different from + `resname` (in this case, carried over from an upstream decision between + the two) *name_index_pairs* - dictionary with key-value pair for dihedral atom group, - atom indices, and bond indices + dictionary with key-value pair for dihedral atom group, atom indices, + and bond indices .. seealso:: :func:`~mdpow.workflows.dihedrals.get_paired_indices` @@ -647,12 +647,12 @@ def build_svg( *solvents* The default solvents are documented under :data:`SOLVENTS_DEFAULT`. - Normally takes a two-tuple, but analysis is compatible with single solvent selections. - Single solvent analyses will result in a figure with fully filled violins for the single solvent. + Normally takes a two-tuple, but analysis is compatible with single + solvent selections. Single solvent analyses will result in a figure + with fully filled violins for the single solvent. *width* - width of the violin element (>1 overlaps) - default: 0.9 + width of the violin element (>1 overlaps); default: 0.9 :returns: