Skip to content

Commit

Permalink
Merge pull request #50 from marjanAlbouye/docstrings
Browse files Browse the repository at this point in the history
Complete docstrings
  • Loading branch information
marjanalbooyeh authored Sep 25, 2023
2 parents 5c47cc4 + 102018d commit d71f21e
Show file tree
Hide file tree
Showing 40 changed files with 1,550 additions and 188 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,7 @@ dmypy.json

# IDE files
.idea/

# emacs backup saves
*.~
*.#
82 changes: 41 additions & 41 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: [ ]
submodules: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: 'hoomd_organics/tests/assets/.* | hoomd_organics/assets/.*'
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
args: [--line-length=80]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args:
[--profile=black, --line-length=80]
exclude: 'cmeuitls/tests/assets/.* '
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: 'hoomd_organics/tests/assets/.* | hoomd_organics/assets/.*'
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
args: [ --line-length=80 ]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args:
[ --profile=black, --line-length=80 ]
exclude: 'cmeuitls/tests/assets/.* '

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
args:
- --max-line-length=80
exclude: '__init__.py'
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
args:
- --max-line-length=80
exclude: '__init__.py'

#- repo: https://github.com/pycqa/pydocstyle
# rev: '6.3.0'
# hooks:
# - id: pydocstyle
# exclude: ^(cmeuitls/tests/|setup.py)
# args: [--convention=numpy]
- repo: https://github.com/pycqa/pydocstyle
rev: '6.3.0'
hooks:
- id: pydocstyle
exclude: ^(hoomd_organics/tests/|hoomd_organics/utils/|setup.py|hoomd_organics/__version__.py|docs/)
args: [ --convention=numpy ]
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# .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: "miniconda3-4.7"

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

conda:
environment: environment-readthedocs.yml
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
[![pytest](https://github.com/cmelab/hoomd-organics/actions/workflows/pytest.yml/badge.svg)](https://github.com/cmelab/hoomd-organics/actions/workflows/pytest.yml)
[![codecov](https://codecov.io/gh/cmelab/hoomd-organics/branch/main/graph/badge.svg?token=86LY9WHSH6)](https://codecov.io/gh/cmelab/hoomd-organics)
## About
## HOOMD-Organics
HOOMD-Organics is a modular “wrapper” package for molecular dynamics (MD)
simulation pipeline development, designed to enable fast, reproducible,
end-to- end simulation workflows with minimal user effort. This package is a
wrapper for [MoSDeF](https://github.com/mosdef-hub) packages and
[Hoomd-Blue](https://github.com/glotzerlab/hoomd-blue) with a focus on
simulating soft matter systems.

An object-oriented design makes HOOMD-Organics extensible and highly flexible.
This is bolstered by a library-based approach to system initialization, making
HOOMD-Organics agnostic to system identity, forcefield, and thermodynamic
ensemble, and allowing for growth on an as-needed basis.


Wrapper for [MoSDeF](https://github.com/mosdef-hub) packages and [Hoomd-Blue](https://github.com/glotzerlab/hoomd-blue) with
a focus on simulating soft matter systems.

## Installation

Expand All @@ -23,5 +33,12 @@ python -m pip install .
```

## Basic Usage
#### Using the built in molecules, systems and forcefields:
README, documentation and tutorials are a work in progress.
Please checkout the [tutorials](tutorials) for a detailed description of
how to use HOOMD-Organics and what functionalities it provides.

## Documentation
Documentation is available at [(path to readthedocs)]()

[//]: # (#### Using the built in molecules, systems and forcefields:)

[//]: # (README, documentation and tutorials are a work in progress.)
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 = source
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)
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=source
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
19 changes: 19 additions & 0 deletions docs/source/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Base
=====

.. rubric:: Overview

.. py:currentmodule:: hoomd_organics.base
.. rubric:: Details

.. automodule:: hoomd_organics.base

.. rubric:: Modules

.. toctree::
:maxdepth: 1

molecule
system
simulation
53 changes: 53 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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
import os
import sys

project = "hoomd-organics"
copyright = (
"2023, Chris Jones, Marjan Albooyeh, Rainier Barrett, Eric Jankowski"
)
author = "Chris Jones, Marjan Albooyeh, Rainier Barrett, Eric Jankowski"

sys.path.insert(0, os.path.abspath("../.."))

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

extensions = ["nbsphinx", "sphinx.ext.autodoc", "sphinx.ext.napoleon"]
autodoc_mock_imports = [
"cmeutils",
"forcefield_utilities",
"foyer",
"freud",
"gmso",
"grits",
"gsd",
"hoomd",
"mbuild",
"numpy",
"openbabel",
"py3Dmol",
"pydantic",
"symengine",
"sympy",
"unyt",
"jupyter",
]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
nbsphinx_execute = "never"
nbsphinx_allow_errors = True
source_suffix = [".rst"]

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

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
9 changes: 9 additions & 0 deletions docs/source/forcefields.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
forcefields
-----------

.. py:currentmodule:hoomd_organics.library
.. rubric:: Details

.. automodule:: hoomd_organics.library.forcefields
:members:
43 changes: 43 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Welcome to hoomd-organics's documentation!
==========================================


HOOMD-Organics is a modular “wrapper” package for molecular dynamics (MD)
simulation pipeline development, designed to enable fast, reproducible, end-to-
end simulation workflows with minimal user effort. An object-oriented design
makes HOOMD-Organics extensible and highly flexible. This is bolstered by a
library-based approach to system initialization, making HOOMD-Organics agnostic
to system identity, forcefield, and thermodynamic ensemble, and allowing
for growth on an as-needed basis.

Quick start
===========
.. toctree::
installation


Resources
=========

`GitHub Repository <https://github.com/cmelab/hoomd-organics>`_: Source code and issue tracker.

`Tutorials <https://github.com/cmelab/hoomd-organics/tree/main/tutorials>`_: Examples of how to use HOOMD-Organics.


.. toctree::
:maxdepth: 2
:caption: Python API

base
modules
library
tutorials



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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
19 changes: 19 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
============
Installation
============

Install from source
---------------------------------------

1. Clone this repository:
::

$ git clone git@github.com:cmelab/hoomd-organics.git
$ cd hoomd-organics

2. Set up and activate environment:
::

$ conda env create -f environment-cpu.yml
$ conda activate hoomd-organics
$ python -m pip install .
19 changes: 19 additions & 0 deletions docs/source/library.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Library
=======

.. rubric:: Overview

.. py:currentmodule:: hoomd_organics.library
.. rubric:: Details

.. automodule:: hoomd_organics.library

.. rubric:: Library

.. toctree::
:maxdepth: 1

polymers
forcefields
simulations
17 changes: 17 additions & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Modules
=======

.. rubric:: Overview

.. py:currentmodule:: hoomd_organics.modules
.. rubric:: Details

.. automodule:: hoomd_organics.modules

.. rubric:: Modules

.. toctree::
:maxdepth: 1

welding
Loading

0 comments on commit d71f21e

Please sign in to comment.