Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
[msm] split up separate MSM estimators into individual files (#1390)
Browse files Browse the repository at this point in the history
* [msm] split up separate MSM estimators into individual files

Rationale:
The maximum-likelihood module contained a base class, ml, oom and augmented
estimators adding up to >2k lines of code, which makes it hard to maintain.

Fixes #1260
  • Loading branch information
marscher authored Feb 12, 2019
1 parent 28923c6 commit 58a5345
Show file tree
Hide file tree
Showing 12 changed files with 1,850 additions and 1,765 deletions.
3 changes: 1 addition & 2 deletions devtools/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ test:
- pytest
- pytest-cov
- coverage
# TODO: disabled on win64, until https://bugs.python.org/issue31701 is fixed.
- pytest-faulthandler # [not win]
- pytest-faulthandler
- pytest-xdist
- scikit-learn
# https://github.com/Frozenball/pytest-sugar/issues/124
Expand Down
8 changes: 4 additions & 4 deletions pyemma/msm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
BayesianHMSM
**Models** of the kinetics or stationary properties of the data.
**Models** of the kinetics or stationary properties of the data.
If you are not an expert user, use the API functions above.
.. autosummary::
Expand All @@ -84,14 +84,14 @@

#####################################################
# Estimators and models
from .models import MSM, HMSM, SampledMSM, SampledHMSM, ReactiveFlux

from .estimators import MaximumLikelihoodMSM, BayesianMSM
from .estimators import MaximumLikelihoodHMSM, BayesianHMSM
from .estimators import OOMReweightedMSM
from .estimators import AugmentedMarkovModel
from .estimators import AugmentedMarkovModel, OOMReweightedMSM
from .estimators import ImpliedTimescales
from .estimators import ChapmanKolmogorovValidator

from .models import MSM, HMSM, SampledMSM, SampledHMSM, ReactiveFlux

# high-level api
from .api import *
4 changes: 3 additions & 1 deletion pyemma/msm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
# =============================================================================


# TODO: show_progress is not documented
@shortcut('its')
def timescales_msm(dtrajs, lags=None, nits=None, reversible=True, connected=True, weights='empirical',
errors=None, nsamples=50, n_jobs=None, show_progress=True, mincount_connectivity='1/n',
Expand Down Expand Up @@ -119,6 +118,9 @@ def timescales_msm(dtrajs, lags=None, nits=None, reversible=True, connected=True
n_jobs : int, optional
how many subprocesses to start to estimate the models for each lag time.
show_progress : bool, default=True
whether to show progress of estimation.
mincount_connectivity : float or '1/n'
minimum number of counts to consider a connection between two states.
Counts lower than that will count zero in the connectivity check and
Expand Down
18 changes: 18 additions & 0 deletions pyemma/msm/estimators/_OOM_MSM.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@

# This file is part of PyEMMA.
#
# Copyright (c) 2014-2019 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import numpy as np
import scipy.linalg as scl
import scipy.sparse
Expand Down
4 changes: 2 additions & 2 deletions pyemma/msm/estimators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
__author__ = 'noe'

from .maximum_likelihood_msm import MaximumLikelihoodMSM
from .maximum_likelihood_msm import OOMReweightedMSM
from .maximum_likelihood_msm import AugmentedMarkovModel
from .oom_reweighted_msm import OOMReweightedMSM
from .augmented_msm import AugmentedMarkovModel
from .bayesian_msm import BayesianMSM
from .maximum_likelihood_hmsm import MaximumLikelihoodHMSM
from .bayesian_hmsm import BayesianHMSM
Expand Down
Loading

0 comments on commit 58a5345

Please sign in to comment.