Skip to content

Commit

Permalink
Merge branch 'master' into ray_documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Feb 27, 2020
2 parents f9c9aef + e1025a5 commit 7035e73
Show file tree
Hide file tree
Showing 111 changed files with 951 additions and 464 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,13 @@ Icon
Network Trash Folder
Temporary Items
.apdisk

# GROMACS files
*.cpt
*.edr
*.xtc
*.trr
*.tpr

# LAMMPS files
*.lammpstrj
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
## Topology: Flexible storage of chemical topology for molecular simulation
## GMSO: General Molecular Simulation Object

Flexible storage of chemical topology for molecular simulation
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- bash: |
source activate test-environment
python -m pytest -v topology
python -m pytest -v gmso/tests/
displayName: Run Tests
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

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

project = 'topology'
project = 'gmso'
copyright = '2020, mosdef-hub, Vanderbilt University'
author = 'Matt Thompson, Alex Yang, Ray Matsumoto, Parashara Shamaprasad, Umesh Timalsina, Co Quach, Ryan S. DeFever, Justin Gilmer'

Expand Down
57 changes: 55 additions & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
Contributing
------------
plz help
============
Contributions are welcomed via `pull requests on GitHub <https://github.com/mattwthompson/topology/pulls>`_. Developers and/or
users will review requested changes and make comments. The rest of this file will serve as a set of general guidelines
for contributors.

Features
--------
Implement functionality in a general and flexible fashion
*********************************************************
GMSO is designed to be general and flexible, not limited to single chemistries, file formats, simulation engines, or
simulation methods. Additions to core features should attempt to provide something that is applicable to a variety of
use-cases and not targeted at only the focus area of your research. However, some specific features targeted toward
a limited use case may be appropriate. Speak to the developers before writing your code and they will help you make design
choices that allow flexibility.

Version control
---------------

We currently use the "standard" Pull Request model. Contributions should be implemented on feature branches of forks.
Please try to keep the `master` branch of your fork up-to-date with the `master` branch of the main repository.

Propose a single set of related changes
****************************************

Small changes are preferred over large changes. A major contribution can often be broken down into smaller PRs. Large PRs that
affect many parts of the codebase can be harder to review and are more likely to cause merge conflicts.

Source code
-----------
Use a consistent style
*************************
It is important to have a consistent style throughout the source code. The following criteria are desired:

* Lines wrapped to 80 characters
* Lines are indented with spaces
* Lines do not end with whitespace
* For other details, refer to `PEP8 <https://www.python.org/dev/peps/pep-0008>`_

To help with the above, there are tools such as `flake8 <https://pypi.org/project/flake8/>`_ and `Black <https://github.com/psf/black>`_.

Document code with comments
****************************
All public-facing functions should have docstrings using the numpy style. This includes concise paragraph-style description
of what the class or function does, relevant limitations and known issues, and descriptions of arguments. Internal functions
can have simple one-liner docstrings.


Tests
-----
Write unit tests
****************
All new functionality in GMSO should be tested with automatic unit tests that execute in a few seconds. These tests
should attempt to cover all options that the user can select. All or most of the added lines of source code should be
covered by unit test(s). We currently use `pytest <https://docs.pytest.org/en/latest/>`_, which can be executed simply by calling
`pytest` from the root directory of the package.
22 changes: 11 additions & 11 deletions docs/data_structures.rst
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
Data Structures in topology
Data Structures in GMSO
---------------------------
Following data structures are available within topology, which are generally referred to `CoreMembers` and `CoreTypes`.
Following data structures are available within GMSO, which are generally referred to `CoreMembers` and `CoreTypes`.

Core Members
=============

Site
****
.. autoclass:: topology.Site
.. autoclass:: gmso.Site
:members:

Bond
****
.. autoclass:: topology.Bond
.. autoclass:: gmso.Bond
:members:

Angle
*****
.. autoclass:: topology.Angle
.. autoclass:: gmso.Angle
:members:

Dihedral
********
.. autoclass:: topology.Dihedral
.. autoclass:: gmso.Dihedral
:members:

Potential Classes(CoreTypes)
============================
.. autoclass:: topology.Potential
.. autoclass:: gmso.Potential
:members:

AtomType
********
.. autoclass:: topology.AtomType
.. autoclass:: gmso.AtomType
:members:

BondType
********
.. autoclass:: topology.BondType
.. autoclass:: gmso.BondType
:members:

AngleType
**********
.. autoclass:: topology.AngleType
.. autoclass:: gmso.AngleType
:members:

DihedralType
************
.. autoclass:: topology.DihedralType
.. autoclass:: gmso.DihedralType
:members:


18 changes: 9 additions & 9 deletions docs/design_principles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
Design Principles
=================

Scope and Features of ``Topology``
Scope and Features of ``GMSO``
----------------------------------

``Topology`` is designed to enable the flexible, general representation of
``GMSO`` is designed to enable the flexible, general representation of
chemical topologies for molecular simulation. Efforts are made to enable
lossless, bias-free storage of data, without assuming particular chemistries,
models, or using any particular engine's ecosystem as a starting point. The
scope is generally restrained to the preparation, manipulation, and conversion
of and of input files for molecular simulation, i.e. before engines are called
to execute the simulations themselves. ``Topology`` currently does not support
to execute the simulations themselves. ``GMSO`` currently does not support
conversions between trajectory file formats for analysis codes. In the scope of
molecular simulation, we loosely define a chemical topology as everything
needed to reproducibly prepare a chemical system for simulation. This includes
Expand All @@ -20,7 +20,7 @@ particle coordinates and connectivity, box information, force field data
some optional information that may not apply to all systems (i.e. specification
of elements with each particle).

``Topology`` enables the following features:
``GMSO`` enables the following features:

* Supporting a variety of models in the molecular simulation/computational
chemistry community: No assumptions are made about an interaciton site
Expand All @@ -40,7 +40,7 @@ of elements with each particle).


* Compatibility with existing community tools: No single molecular simulation
tool will be a silver bullet, so ``Topology`` includes functions to convert
tool will be a silver bullet, so ``GMSO`` includes functions to convert
objects. These can be used in their own right to convert between objects in
memory and also to support conversion to file formats not natively support at
any given time. Currently supported conversions include ``ParmEd``,
Expand All @@ -52,10 +52,10 @@ of elements with each particle).
libraries, for many more!


Structure of ``Topology``
Structure of ``GMSO``
-------------------------
There are three main modules within the Python package:

* ``topology.core`` stores the classes that constitute the core data structures.
* ``topology.formats`` stores readers and writers for (on-disk) file formats.
* ``topology.external`` includes functions that convert core data structures between external libraries and their internal representation.
* ``gmso.core`` stores the classes that constitute the core data structures.
* ``gmso.formats`` stores readers and writers for (on-disk) file formats.
* ``gmso.external`` includes functions that convert core data structures between external libraries and their internal representation.
4 changes: 2 additions & 2 deletions docs/forcefield.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ForceField
==========
A force field class implemented for topology core objects
A force field class implemented for GMSO core objects

.. autoclass:: topology.ForceField
.. autoclass:: gmso.ForceField
:members:

6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. topology documentation master file, created by
.. GMSO documentation master file, created by
sphinx-quickstart on Mon Feb 24 11:46:58 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Topology: Flexible storage of chemical topology for molecular simulation
========================================================================
GMSO: Flexible storage of chemical topology for molecular simulation
====================================================================

.. toctree::
:hidden:
Expand Down
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Installation
Installing dependencies with `conda <http://continuum.io/downloads>`_
---------------------------------------------------------------------

Dependencies of ``Topology`` are listed in the file ``requirements.txt``. They
Dependencies of ``GMSO`` are listed in the file ``requirements.txt``. They
can be installed in one line:
::

Expand Down Expand Up @@ -40,7 +40,7 @@ Installing dependencies with `pip <https://pypi.org/project/pip/>`_
Install an editable version from source
---------------------------------------

Once all dependencies are installed, the ``Topology`` itself can be installed.
Once all dependencies are installed, the ``GMSO`` itself can be installed.
It is currently only available through its source code. It will be available
through ``pip`` and ``conda`` in the future.
::
Expand All @@ -62,7 +62,7 @@ is made to support Python 2 because it is considered obsolete as of early 2020.
Testing your installation
-------------------------

``Topology`` uses ``py.test`` to execute its unit tests. To run them, first install some extra depdencies:
``GMSO`` uses ``py.test`` to execute its unit tests. To run them, first install some extra depdencies:
::
$ conda install --file requirements-test.txt

Expand Down
12 changes: 6 additions & 6 deletions examples/argon/argon.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"metadata": {},
"source": [
"This example requires GROMACS. You can install it from source or conda via `conda install -c bioconda gromacs`.\n",
"You also need to `pip install -e` the topology package after February 14, 2020, when PR #121 was merged."
"You also need to `pip install -e` the topology or GMSO package after February 14, 2020, when PR #121 was merged."
]
},
{
Expand All @@ -27,10 +27,10 @@
"warnings.filterwarnings('ignore')\n",
"\n",
"import mbuild as mb\n",
"import topology as topo\n",
"from topology.external.convert_mbuild import from_mbuild\n",
"from topology.formats.gro import write_gro\n",
"from topology.formats.top import write_top"
"import gmso\n",
"from gmso.external.convert_mbuild import from_mbuild\n",
"from gmso.formats.gro import write_gro\n",
"from gmso.formats.top import write_top"
]
},
{
Expand Down Expand Up @@ -72,7 +72,7 @@
"top = from_mbuild(packed_system)\n",
"\n",
"# Load force field from XML\n",
"ff = topo.ForceField('ar.xml')\n",
"ff = gmso.ForceField('ar.xml')\n",
"ar_type = ff.atom_types['Ar']\n",
"\n",
"# Manually set types, bypassing foyer or any atomtyping engine\n",
Expand Down
File renamed without changes.
File renamed without changes.
30 changes: 18 additions & 12 deletions topology/core/angle.py → gmso/core/angle.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import warnings

from topology.core.connection import Connection
from topology.core.angle_type import AngleType
from topology.exceptions import TopologyError
from gmso.core.connection import Connection
from gmso.core.angle_type import AngleType
from gmso.exceptions import GMSOError


class Angle(Connection):
"""A 3-partner connection between sites.
Partners
--------
connection_members: list of topology.Site
Should be length 3
connection_type : topology.AngleType
name : name of the angle
inherits the name attribute from Connection
This is a subclass of the gmso.Connection superclass.
This class has strictly 3 members in its connection members.
The connection_type in this class corresponds to gmso.AngleType.
Parameters
----------
connection_members: list of gmso.Site
3 sites of an angle.
connection_type : gmso.AngleType, optional, default=None
AngleType of this angle.
name : str, optional, default="Angle"
Name of the angle.
Notes
-----
Expand All @@ -33,8 +38,9 @@ def __init__(self, connection_members=[], connection_type=None, name="Angle"):

def _validate_three_partners(connection_members):
"""Ensure 3 partners are involved in Angle"""
assert connection_members is not None, "connection_members is not given"
if len(connection_members) != 3:
raise TopologyError("Trying to create an Angle "
raise GMSOError("Trying to create an Angle "
"with {} connection members". format(len(connection_members)))

return connection_members
Expand All @@ -45,5 +51,5 @@ def _validate_angletype(contype):
if contype is None:
warnings.warn("Non-parametrized Angle detected")
elif not isinstance(contype, AngleType):
raise TopologyError("Supplied non-AngleType {}".format(contype))
raise GMSOError("Supplied non-AngleType {}".format(contype))
return contype
Loading

0 comments on commit 7035e73

Please sign in to comment.