1) When using clean_traj=False with multiple trajectories, you call map_to_integers on each trajectory separately:
|
newseq, m_dict = map_to_integers(seq, seq_map) |
and for each trajectory you start counting new state indexes from 0:
hence if the 1st trajectory doesn't contain all states, you'll map the 'new' states from further trajectories to index 0 etc. again
Extra suggestion: you return m_dict here:
|
newseq, m_dict = map_to_integers(seq, seq_map) |
but use seq_map (which luckily had been modified in place by map_to_integers) eventually instead:
2) When using coarse_macrostates=True the original dtrajs are not copied and get modified:
which is not great if you don't know about this and want to use the same dtrajs downstream...
3) You use **kwargs:
|
coarse_macrostates=False, **kwargs): |
they don't actually get passed to anything, but cause trouble if you misspell the existing keyword arguments - there's no error, e.g. I kept misspelling clean_trajs instead of clean_traj and it took me a while to realize why my transition paths were coming out wrong.
4) fit using list dtrajs is 6x faster than with int64 numpy array, and 36x faster than with int32 numpy array -- it should convert arrays to lists.
1) When using
clean_traj=Falsewith multiple trajectories, you callmap_to_integerson each trajectory separately:NMpathAnalysis/nmpath/nmm.py
Line 101 in d4be6ba
and for each trajectory you start counting new state indexes from 0:
NMpathAnalysis/nmpath/auxfunctions.py
Line 284 in d4be6ba
hence if the 1st trajectory doesn't contain all states, you'll map the 'new' states from further trajectories to index 0 etc. again
Extra suggestion: you return
m_dicthere:NMpathAnalysis/nmpath/nmm.py
Line 101 in d4be6ba
but use
seq_map(which luckily had been modified in place bymap_to_integers) eventually instead:NMpathAnalysis/nmpath/nmm.py
Line 107 in d4be6ba
2) When using
coarse_macrostates=Truethe original dtrajs are not copied and get modified:NMpathAnalysis/nmpath/nmm.py
Line 65 in d4be6ba
which is not great if you don't know about this and want to use the same dtrajs downstream...
3) You use
**kwargs:NMpathAnalysis/nmpath/nmm.py
Line 59 in d4be6ba
they don't actually get passed to anything, but cause trouble if you misspell the existing keyword arguments - there's no error, e.g. I kept misspelling
clean_trajsinstead ofclean_trajand it took me a while to realize why my transition paths were coming out wrong.4)
fitusinglistdtrajs is 6x faster than with int64 numpy array, and 36x faster than with int32 numpy array -- it should convert arrays to lists.