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

Add Ensemble Objects #179

Merged
merged 39 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3820f64
Commit ensemble.py and ensemble_test.py
Aug 2, 2021
ed54dcf
Add methods + docs and tests
Aug 3, 2021
e5e65d4
Adding ensemble.py docs page
ALescoulie Aug 5, 2021
7c5bd4a
install alchemlyb<0.5.0 for Python 2 (#182)
orbeckst Aug 4, 2021
c74507a
fixing typos (#176)
orbeckst Aug 4, 2021
516d4d4
work around bug in gromacs.utilities.AttributeDict
orbeckst Aug 5, 2021
bf0b90a
mdpow.fep.p_transfer fixes
orbeckst Aug 5, 2021
14b151c
doc updates
orbeckst Aug 4, 2021
79f6aba
update CHANGES for 0.7.1
orbeckst Aug 4, 2021
8258b30
switch RTD to Python 3.8
orbeckst Aug 5, 2021
d67861c
cleaner release printing in docs
orbeckst Aug 5, 2021
f95e538
Add absolute path to universe definition ensemble.py
ALescoulie Aug 16, 2021
dd80c20
Remove python 2 Support in MDPOW (#178)
ALescoulie Aug 17, 2021
84b1648
updated installation instructions for Python 3 only
orbeckst Aug 17, 2021
0fb0182
config.POWConfigParser fixes and enhancements
orbeckst Aug 17, 2021
4584b8e
Add EnsembleAtomGroup class method tests
ALescoulie Aug 23, 2021
5e6c141
update ensemble.py system reader
ALescoulie Aug 24, 2021
0f87f67
Replace testfiles
ALescoulie Aug 24, 2021
f19b177
add test for top_paths kwarg
ALescoulie Aug 24, 2021
da96110
modify load_universe
ALescoulie Aug 24, 2021
4099d8a
Improve docs and naming
ALescoulie Aug 25, 2021
4abfb25
Reorganize ensemble into subpackage and fix imports
ALescoulie Aug 27, 2021
78991bd
Fix docs and misc files
ALescoulie Aug 27, 2021
004e62c
Update mdpow/tests/test_ensemble.py
ALescoulie Aug 28, 2021
58739d2
improve test_ensemble.py and ensemble.py exceptions
ALescoulie Aug 28, 2021
f896243
Reorganize docs
ALescoulie Aug 29, 2021
54291b1
update ensemble.py methods
ALescoulie Aug 31, 2021
455b4c3
add test tpr
ALescoulie Aug 31, 2021
7b259fd
add test tpr
ALescoulie Aug 31, 2021
348ba2d
fix docs links
ALescoulie Sep 3, 2021
f609cd3
update manifest.yml
ALescoulie Sep 3, 2021
6c4374b
Merge branch 'develop' into ensemble
orbeckst Sep 6, 2021
76cfca0
Restructure _load_universe_from_dir and add_universe methods
ALescoulie Sep 7, 2021
406c713
Merge remote-tracking branch 'origin/ensemble' into ensemble
ALescoulie Sep 7, 2021
fef50e7
fix _load_universe_from_dir and add kwargs option
ALescoulie Sep 7, 2021
d7a9db2
improve select_systems
ALescoulie Sep 7, 2021
dfe214e
simplify __eq__
ALescoulie Sep 7, 2021
1c03210
Compress test files and fix _load_universe_from_dir
ALescoulie Sep 9, 2021
6b19d49
Update docs
ALescoulie Sep 9, 2021
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
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Enhancements
* new config.NoOptionWarning when undefined options are used (with
default None) and POWConfigParser.get() now logs when an option is used
at level DEBUG (PR #187)
* new Ensemble and EnsembleAtomGroup objects for loading set of system
simulations (PR #179)
* new EnsembleAnalysis framework for collecting data from MDPOW simulations (PR #179)


Fixes
Expand Down
19 changes: 19 additions & 0 deletions doc/sphinx/source/analysis.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
==================
Analysis Submodule
==================

orbeckst marked this conversation as resolved.
Show resolved Hide resolved
.. versionadded:: 0.8.0

orbeckst marked this conversation as resolved.
Show resolved Hide resolved
MDPOW module for analyzing simulations. The :doc:`analysis/ensemble` objects
and :doc:`analysis/ensemble_analysis` allow for the construction the simplified of analyses.

The :doc:`analysis/ensemble` and :doc:`analysis/ensemble_analysis` sections
assumes a basic understanding of object oriented programming in python and
are for users who wish to construct their own analyses.


.. toctree::
:maxdepth: 1

orbeckst marked this conversation as resolved.
Show resolved Hide resolved
analysis/ensemble
analysis/ensemble_analysis
45 changes: 45 additions & 0 deletions doc/sphinx/source/analysis/ensemble.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
================
Ensemble Objects
================
orbeckst marked this conversation as resolved.
Show resolved Hide resolved

.. versionadded:: 0.8.0

Ensemble
________

The :class:`~mdpow.analysis.ensemble.Ensemble` object is a collection
of :class:`MDAnalysis.Universe <MDAnalysis.core.groups.universe.Universe>` objects.
It is intended to store the set of systems generated by running :program:`mdpow-fep`.

The :class:`~mdpow.analysis.ensemble.Ensemble` object works by storing the
systems in a dictionary and extending the functionality of an
:class:`MDAnalysis.Universe <MDAnalysis.core.groups.universe.Universe>` to a collection
of universes. It when given a directory finds the simulation files, reads then loads
them into a dictionary. The object can be indexed the same as a dictionary,
and has methods analogous the the :class:`MDAnalysis.Universe <MDAnalysis.core.groups.universe.Universe>` object. The main
one being :meth:`~mdpow.analysis.ensemble.Ensemble.select_atoms` which returns a
:class:`~mdpow.analysis.ensemble.EnsembleAtomGroup` .
An :class:`~mdpow.analysis.ensemble.Ensemble` in its current form
can also be built by manually adding and popping universes into an empty instance.

.. autoclass:: mdpow.analysis.ensemble.Ensemble
:members:

.. automethod:: _build_ensemble

.. automethod:: _load_universe_from_dir

EnsembleAtomGroup
_________________

The :class:`~mdpow.analysis.ensemble.EnsembleAtomGroup` is created by running
the on an :class:`~mdpow.analysis.ensemble.Ensemble`
:meth:`~mdpow.analysis.ensemble.Ensemble.select_atoms`. It stores
:class:`MDAnalysis.AtomGroup <MDAnalysis.core.groups.AtomGroup>` selections of the groups
generated by running select atom on individual universes in a dictionary with
the same key structure as the parent :class:`~mdpow.analysis.ensemble.Ensemble`
class. It returns a copy of the parent :class:`~mdpow.analysis.ensemble.Ensemble`
object when the :meth:`~mdpow.analysis.ensemble.EnsembleAtomGroup.ensemble` is run.

.. autoclass:: mdpow.analysis.ensemble.EnsembleAtomGroup
:members:
39 changes: 39 additions & 0 deletions doc/sphinx/source/analysis/ensemble_analysis.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
============================
Ensemble Analysis Framework
============================

.. versionadded:: 0.8.0
orbeckst marked this conversation as resolved.
Show resolved Hide resolved

The Analysis modules help in the implementation analyses of
MDPOW simulations. To simplify the process of analyzing
a collection of systems generated by a free energy simulation
the objects in :doc:`analysis/ensemble` allow for a molecule directory's
systems to be loaded into `MDAnalysis <https://mdanalysis.org>`_
Universes and be analyzed as a group.

Ensemble Analysis Framework
===========================

EnsembleAnalysis
----------------

:class:`~mdpow.analysis.ensemble.EnsembleAnalysis` is a class inspired by the
:class:`AnalysisBase <MDAnalysis.analysis.base.AnalysisBase>` from MDAnalysis which
iterates over the systems in the ensemble and the frames in the systems. It sets up both iterations between
universes and universe frames allowing for analysis to be run on both whole systems and the frames of those
systems. This allows for users to easily run analyses on MDPOW simulations.

.. autoclass:: mdpow.analysis.ensemble.EnsembleAnalysis
:members:

.. automethod:: _prepare_ensemble

.. automethod:: _prepare_universe

.. automethod:: _single_universe

.. automethod:: _single_frame

.. automethod:: _conclude_ensemble

.. automethod:: _conclude_universe
2 changes: 1 addition & 1 deletion doc/sphinx/source/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ For current issues and open feature requests please look through the
fep
utilities
forcefields

analysis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current doc build, analysis is not numbered in the menu. Figure out how to make it so that it is numbered. Perhaps there's something with the toctree in the analysis.txt file that interferes. Either way, needs to be fixed.

See

menu_no_numbers_analysis

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


.. rubric:: Indices and tables

Expand Down
2 changes: 2 additions & 0 deletions mdpow/analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Analysis Subpackage
# Alia Lescoulie (ALescoulie) 2021
Loading