|
16 | 16 | from ._decomposition import timescales_from_eigenvalues
|
17 | 17 |
|
18 | 18 | from . import dense
|
19 |
| -from . import sparse |
20 | 19 | from . import _assessment
|
21 | 20 | from . import _mean_first_passage_time
|
22 | 21 | from . import _decomposition
|
23 | 22 | from . import _fingerprints
|
| 23 | +from . import _committor |
| 24 | +from . import _expectations |
24 | 25 |
|
25 | 26 | __docformat__ = "restructuredtext en"
|
26 | 27 | __authors__ = __author__ = "Benjamin Trendelkamp-Schroer, Martin Scherer, Jan-Hendrik Prinz, Frank Noe"
|
@@ -739,26 +740,15 @@ def committor(T, A, B, forward=True, mu=None):
|
739 | 740 | T = ensure_number_array(T, ndim=2)
|
740 | 741 | A = ensure_integer_array(A, ndim=1)
|
741 | 742 | B = ensure_integer_array(B, ndim=1)
|
742 |
| - if _issparse(T): |
743 |
| - if forward: |
744 |
| - return sparse.committor.forward_committor(T, A, B) |
745 |
| - else: |
746 |
| - """ if P is time reversible backward commitor is equal 1 - q+""" |
747 |
| - if is_reversible(T, mu=mu): |
748 |
| - return 1.0 - sparse.committor.forward_committor(T, A, B) |
749 |
| - |
750 |
| - else: |
751 |
| - return sparse.committor.backward_committor(T, A, B) |
752 |
| - |
| 743 | + if forward: |
| 744 | + return _committor.forward_committor(T, A, B) |
753 | 745 | else:
|
754 |
| - if forward: |
755 |
| - return dense.committor.forward_committor(T, A, B) |
| 746 | + """ if P is time reversible backward commitor is equal 1 - q+""" |
| 747 | + if is_reversible(T, mu=mu): |
| 748 | + return 1.0 - _committor.forward_committor(T, A, B) |
| 749 | + |
756 | 750 | else:
|
757 |
| - """ if P is time reversible backward commitor is equal 1 - q+""" |
758 |
| - if is_reversible(T, mu=mu): |
759 |
| - return 1.0 - dense.committor.forward_committor(T, A, B) |
760 |
| - else: |
761 |
| - return dense.committor.backward_committor(T, A, B) |
| 751 | + return _committor.backward_committor(T, A, B) |
762 | 752 |
|
763 | 753 |
|
764 | 754 | ################################################################################
|
@@ -811,10 +801,7 @@ def expected_counts(T, p0, N):
|
811 | 801 | T = ensure_number_array(T, ndim=2)
|
812 | 802 | p0 = ensure_floating_array(p0, ndim=1)
|
813 | 803 | # go
|
814 |
| - if _issparse(T): |
815 |
| - return sparse.expectations.expected_counts(p0, T, N) |
816 |
| - else: |
817 |
| - return dense.expectations.expected_counts(p0, T, N) |
| 804 | + return _expectations.expected_counts(p0, T, N) |
818 | 805 |
|
819 | 806 |
|
820 | 807 | def expected_counts_stationary(T, N, mu=None):
|
@@ -867,10 +854,7 @@ def expected_counts_stationary(T, N, mu=None):
|
867 | 854 | if mu is not None:
|
868 | 855 | mu = ensure_floating_array(mu, ndim=1)
|
869 | 856 | # go
|
870 |
| - if _issparse(T): |
871 |
| - return sparse.expectations.expected_counts_stationary(T, N, mu=mu) |
872 |
| - else: |
873 |
| - return dense.expectations.expected_counts_stationary(T, N, mu=mu) |
| 857 | + return _expectations.expected_counts_stationary(T, N, mu=mu) |
874 | 858 |
|
875 | 859 |
|
876 | 860 | ################################################################################
|
|
0 commit comments