Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx & Plotting Documentation #41

Merged
merged 26 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d9b896c
remove redundant function definition
EzryStIago Mar 22, 2024
e8097a2
snake case variables
EzryStIago Mar 22, 2024
aa0ec1d
cosmesis and PEP8 compliance improvements: variable names, line lengt…
EzryStIago Mar 27, 2024
86b9492
documentation and whitespace
EzryStIago Mar 27, 2024
d3e45f7
resolve documentation conflicts
EzryStIago Mar 27, 2024
be92e10
config files for sphinx
EzryStIago Mar 31, 2024
04d9a48
adding getting-started
EzryStIago Mar 31, 2024
d0ec1fb
adding tutorial link
EzryStIago Mar 31, 2024
c10cd8b
cleanup outdated documentation
EzryStIago Mar 31, 2024
792e224
adding readthedocs yaml
EzryStIago Mar 31, 2024
56919ad
adding dependencies for building the documentation
EzryStIago Mar 31, 2024
1445d4d
adding pyproject for pypi
EzryStIago Mar 31, 2024
552088a
add package to conf imports
EzryStIago Mar 31, 2024
622fe96
add safep to requirements
EzryStIago Mar 31, 2024
80011cd
remove safep from conf
EzryStIago Mar 31, 2024
0ed3b42
adding numpy and some other higher level requirements
EzryStIago Mar 31, 2024
bb0f5ae
add scipy
EzryStIago Apr 1, 2024
3677b13
add alchemlyb and pymbar
EzryStIago Apr 1, 2024
e91ca8d
add tqdm and natsort
EzryStIago Apr 1, 2024
f00784e
Update getting-started.rst
EzryStIago Apr 1, 2024
8d9b892
autosummary on
EzryStIago Apr 2, 2024
19a1e4e
adding dsstore and vscode ignores
EzryStIago Mar 31, 2024
3a1a4b2
moving metadata from setup.py to pyproject.toml in accordance with PE…
EzryStIago May 6, 2024
f9b1cd2
Mark regular expression as raw strings
jhenin May 7, 2024
7e6f90d
Merge branch 'main' into sphinx
EzryStIago May 7, 2024
3e7f36b
moving expanded notebook to legacy - no longer works
EzryStIago May 8, 2024
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
32 changes: 32 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# 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)
Empty file added docs/_static/.gitkeep
Empty file.
36 changes: 36 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import sys
import os
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'safep'
copyright = '2024, Brannigan Lab'
author = 'Brannigan Lab'
release = '0.1.3'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'autodocsumm',
'sphinx.ext.coverage'
]
auto_doc_default_options = {'autosummary': True}
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

sys.path.insert(0, os.path.abspath('../safep'))

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme' # read the docs theme. This variable is 'default' by default.

html_static_path = ['_static']
37 changes: 37 additions & 0 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
getting-started
===============

.. toctree::
:maxdepth: 4

Introduction
------------
SAFEP-related scripts and tools

These scripts and notebooks are broadly applicable to FEP analysis.

A complete tutorial is available at:
`SAFEP Tutorial <https://doi.org/10.33011/livecoms.5.1.2067>`_.

Installation
------------

.. Installation:
0. Clone this repository
1. Enter the repository directory
2. Run ``pip install .``

OR

0. Run ``pip install git+https://github.com/BranniganLab/safep.git``

Notebooks
----------
- BAR_Estimator_Basic: General use FEP analysis. Includes cumulative dG estimates, error estimates, and measures of convergence.
- BAR_Estimator_Expanded: Extended functionality including bootstrapped error estimates, kernel estimation of dL distributions, and more.


Examples
----------
Sample data is available in Sample_Notebooks/Sample_Data or from the alchemtest package.

23 changes: 23 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. safep documentation master file, created by
sphinx-quickstart on Wed Mar 27 13:57:58 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to safep's documentation!
=================================

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

getting-started
modules



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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
7 changes: 7 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
safep
=====

.. toctree::
:maxdepth: 4

safep
11 changes: 11 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
autodocsumm
sphinx_rtd_theme
safep
numpy
pandas
matplotlib
scipy
alchemlyb
pymbar
natsort
tqdm
69 changes: 69 additions & 0 deletions docs/safep.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
safep package
=============

Submodules
----------

safep.AFEP\_parse module
------------------------

.. automodule:: safep.AFEP_parse
:members:
:undoc-members:
:show-inheritance:

safep.TI module
---------------

.. automodule:: safep.TI
:members:
:undoc-members:
:show-inheritance:

safep.estimators module
-----------------------

.. automodule:: safep.estimators
:members:
:undoc-members:
:show-inheritance:

safep.fileIO module
-------------------

.. automodule:: safep.fileIO
:members:
:undoc-members:
:show-inheritance:

safep.helpers module
--------------------

.. automodule:: safep.helpers
:members:
:undoc-members:
:show-inheritance:

safep.plotting module
---------------------

.. automodule:: safep.plotting
:members:
:undoc-members:
:show-inheritance:

safep.processing module
-----------------------

.. automodule:: safep.processing
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: safep
:members:
:undoc-members:
:show-inheritance:
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
dependencies = [
'numpy>=1.22.0',
'pandas>=1.4.0',
'alchemlyb==2.0.0',
'matplotlib>=3.5.0',
'natsort>=7.1.0',
'tqdm',
]

name = 'safep'
version = "0.1.4"

authors = [{name='Brannigan Lab', email='[email protected]'}]

description = 'Tools for Analyzing and Debugging (SA)FEP calculations'
readme = "README.md"

requires-python = ">=3.10"

classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.12',
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/BranniganLab/safep"
Issues = "https://github.com/BranniganLab/safep/issues"
6 changes: 3 additions & 3 deletions safep/fileIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def read_FEPOUT(fileName, step=1):
if line[0] == '#':
frame = 0
#print(line)
Lambda = re.search('LAMBDA SET TO (\d+(\.\d+)*)', line)
Lambda2 = re.search('LAMBDA2 (\d+(\.\d+)*)', line)
LambdaIDWS = re.search('LAMBDA_IDWS (\d+(\.\d+)*)', line)
Lambda = re.search(r'LAMBDA SET TO (\d+(\.\d+)*)', line)
Lambda2 = re.search(r'LAMBDA2 (\d+(\.\d+)*)', line)
LambdaIDWS = re.search(r'LAMBDA_IDWS (\d+(\.\d+)*)', line)
if Lambda:
L = Lambda.group(1)
#print(f'L={L}')
Expand Down
Loading