Skip to content

Commit 1293421

Browse files
authored
Merge pull request #119 from marscher/cleanup
Cleanup test structure, setup now numpy based (like sklearn)
2 parents 54dc76d + 10b4c32 commit 1293421

File tree

212 files changed

+642
-920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+642
-920
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ env:
55
global:
66
- PATH=$HOME/miniconda/bin:$PATH
77
matrix:
8-
- python=2.7 CONDA_PY=27 CONDA_NPY=18
98
- python=3.6 CONDA_PY=36 CONDA_NPY=111
109
- python=3.7 CONDA_PY=37 CONDA_NPY=115
1110

@@ -14,7 +13,7 @@ before_install:
1413
- conda install conda-build=3.15 conda-verify -qy
1514

1615
script:
17-
- conda build tools/conda-recipe --numpy=$CONDA_NPY -c conda-forge/label/gcc7
16+
- conda build tools/conda-recipe --numpy=$CONDA_NPY -c conda-forge
1817

1918
after_script:
2019
- bash <(curl -s https://codecov.io/bash) -f $HOME/coverage.xml -e CONDA_PY

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ recursive-include msmtools *.pyx *.c *.h
1313

1414
include README*
1515
include LICENSE*
16+
17+
include pyproject.toml
18+

appveyor.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ environment:
88
PYTHON: "C:\\Miniconda3-x64"
99

1010
matrix:
11-
- CONDA_PY: "27"
12-
CONDA_NUMPY: "19"
13-
1411
- CONDA_PY: "36"
1512
CONDA_NUMPY: "114"
1613

@@ -21,8 +18,6 @@ install:
2118
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%;"
2219
- conda install conda-build -yq -c defaults
2320
# Build the compiled extension and run the project tests
24-
- "%CMD_IN_ENV% conda build -c conda-forge -q tools/conda-recipe --numpy=%CONDA_NUMPY%"
25-
21+
- conda build -c conda-forge -q tools/conda-recipe --numpy=%CONDA_NUMPY%"
2622

2723
build: false
28-

msmtools/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
3737
3838
"""
39-
from __future__ import absolute_import
4039

4140
from . import analysis
4241
from . import estimation

msmtools/analysis/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,5 @@
108108
expectation_sensitivity
109109
110110
"""
111-
from __future__ import absolute_import
112111

113-
from .api import *
112+
from .api import *

msmtools/analysis/api.py

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
=======================
2424
2525
"""
26-
from __future__ import absolute_import
2726

2827

2928
import warnings
@@ -32,10 +31,10 @@
3231
from scipy.sparse import issparse as _issparse
3332
from scipy.sparse import csr_matrix as _csr_matrix
3433

35-
from msmtools.util.annotators import shortcut
34+
from ..util.annotators import shortcut
3635

3736
# type-checking
38-
from msmtools.util import types as _types
37+
from ..util import types as _types
3938

4039
from . import dense
4140
from . import sparse
@@ -63,7 +62,6 @@
6362
'mfpt',
6463
'committor',
6564
'hitting_probability',
66-
'pcca',
6765
'pcca_sets',
6866
'pcca_assignments',
6967
'pcca_distributions',
@@ -1450,42 +1448,6 @@ def _pcca_object(T, m):
14501448
return dense.pcca.PCCA(T, m)
14511449

14521450

1453-
def pcca(T, m):
1454-
r"""Compute meta-stable sets using PCCA++ _[1] and return the membership of all states to these sets.
1455-
1456-
Parameters
1457-
----------
1458-
T : (n, n) ndarray or scipy.sparse matrix
1459-
Transition matrix
1460-
m : int
1461-
Number of metastable sets
1462-
1463-
Returns
1464-
-------
1465-
clusters : (n, m) ndarray
1466-
Membership vectors. clusters[i, j] contains the membership of state i to metastable state j
1467-
1468-
Notes
1469-
-----
1470-
Perron cluster center analysis assigns each microstate a vector of
1471-
membership probabilities. This assignement is performed using the
1472-
right eigenvectors of the transition matrix. Membership
1473-
probabilities are computed via numerical optimization of the
1474-
entries of a membership matrix.
1475-
1476-
References
1477-
----------
1478-
.. [1] Roeblitz, S and M Weber. 2013. Fuzzy spectral clustering by
1479-
PCCA+: application to Markov state models and data
1480-
classification. Advances in Data Analysis and Classification 7
1481-
(2): 147-179
1482-
1483-
"""
1484-
warnings.warn('pcca method is deprecated because of its unspecific naming and will be removed soon. '+
1485-
'Use pcca_memberships in the future.', DeprecationWarning)
1486-
return pcca_memberships(T, m)
1487-
1488-
14891451
def pcca_memberships(T, m):
14901452
r"""Compute meta-stable sets using PCCA++ _[1] and return the membership of all states to these sets.
14911453
@@ -1846,4 +1808,4 @@ def expectation_sensitivity(T, a):
18461808
_showSparseConversionWarning()
18471809
return dense.sensitivity.expectation_sensitivity(T.toarray(), a)
18481810
else:
1849-
return dense.sensitivity.expectation_sensitivity(T, a)
1811+
return dense.sensitivity.expectation_sensitivity(T, a)

msmtools/analysis/dense/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818

19-
from __future__ import absolute_import
2019

2120
from . import assessment
2221
from . import committor
@@ -27,4 +26,4 @@
2726
from . import hitting_probability
2827
from . import mean_first_passage_time
2928
from . import sensitivity
30-
from . import pcca
29+
from . import pcca

msmtools/analysis/dense/assessment.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818

19-
from __future__ import absolute_import
2019
import numpy as np
2120

2221
# import decomposition
@@ -104,4 +103,4 @@ def is_reversible(T, mu=None, tol=1e-10):
104103
X = mu[:, np.newaxis] * T
105104
return np.allclose(X, np.transpose(X), atol=tol)
106105
else:
107-
raise ValueError("given matrix is not a valid transition matrix.")
106+
raise ValueError("given matrix is not a valid transition matrix.")

msmtools/analysis/dense/committor.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
.. moduleauthor:: B.Trendelkamp-Schroer <benjamin DOT trendelkamp-schroer AT fu-berlin DOT de>
2323
2424
"""
25-
from __future__ import absolute_import, division
26-
from six.moves import range
2725

2826
import numpy as np
2927
from scipy.linalg import solve
@@ -160,4 +158,4 @@ def backward_committor(T, A, B, mu=None):
160158

161159
u = solve(W, r)
162160

163-
return u
161+
return u

msmtools/analysis/dense/correlations.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@
2121
2222
.. moduleauthor:: marscher, noe
2323
'''
24-
from __future__ import absolute_import
2524

2625
import numpy as np
2726

2827
from .decomposition import rdl_decomposition
29-
from six.moves import range
3028

3129

3230
def time_correlation_by_diagonalization(P, pi, obs1, obs2=None, time=1, rdl=None):
@@ -297,4 +295,4 @@ def time_relaxations_direct(P, p0, obs, times=[1]):
297295
start_values = None
298296
for i in range(n_t):
299297
f[i], start_values = time_relaxation_direct_by_mtx_vec_prod(P, p0, obs, times[i], start_values, True)
300-
return f
298+
return f

0 commit comments

Comments
 (0)