Order of coarse grained states in coarse grained flux unclear
The order (indices) of the coarse grained states obtained by
fluxAB = msm.tpt(M, A, B) fluxAB.coarse_grain(my_coarse_sets)
is unclear. A is always at index 0 and and B is always at index n, but the rest of the assignment is unclear. This is particularly confusing if A and B are two metastable sets obtained by PCCA and my_coarse_sets are all PCCA sets. In this case I get a coarse grained flux plot containing the same number of states as metastable sets provided, but with a different numbering. The assignment can be made, but requires matching of microstate indices, which is rather inconvenient.
It would be nice to have information on the change of indices here and a more convenient way to map the indices.
The order of the intermediate sets is random because the coarse graining uses Python set operations to calculate intersections etc. Sets are unordered data structures, this is why we will loose this information on the way.
A very simple solution would be to replace the sets by OrderedSets (implemented in Cython, BSD over there: https://github.com/simonpercivall/orderedset)
We can include the code in _ext and compile the extension accordingly.
Is this a duplicate of #981 ?
Its based on the same problem, but my request is more basic: I would just like to have a convenient way for assigning the output sets to the input sets. How they should be sorted is a different problem which probably needs some discussion.
Sorry, got it. I also thought they'd be sorted by committor anyways, and not randomly. Thanks!
The internal state reshuffling can lead to wrong label placement and state scaling in plot_flux.