-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strict_can_append #473
strict_can_append #473
Conversation
Name might change, but I can start adding the code.
There was an error in the so-called "minus" ensemble used there, so the results it would give did not match what we'd expect from the real minus ensemble for can_prepend. The real minus ensemble is thoroughly tested in another test class, so that's what we should be using. Namespace clashes (two tests with same name) were causing us to not see that one of the tests was wrong. This also includes some starts on the proper strict_can_* for SeqEns.
Still need similar tests for some of the other test classes that build atop SeqEns.
Going to do further checks, but just looking at a simple test, this change means that instead In other words, massive speed improvements for analysis. |
Tested on the analysis notebook where I’d noticed that this was going very badly. Previous timings:
New timings:
So yeah, that’s a little bit faster. Worth the coding effort. Note that these speed-ups are really only relevant when doing analysis using |
Also added fname for debug function info in _generic_short_circuit
Still need strict_can_*
There were some buggy parts of the SeqEns caching. This is also worth checking later that we're not taking a speed hit. But at least the answers are right if you do them twice in a row, unlike before.
Phantastic. This seems really to be a huge improvement. I realized in the alanine example that this step was surprisingly slow (not as slow that it would have been a problem though) and this was only a single call to split. |
Now that it passes tests (and even increases coverage!) I'll call this ready for review. How big of an improvement really depends on how many frames (and how much the trajectory is like the worst-case), since this makes an algorithm that scales as This also includes some cleanup stuff, and notes for further cleanup, in I'm still having frequent problems passing |
Seems to have been more work than I thought. Very good. Merging... |
Yes, |
Resolves #472. See that issue for a detailed description of the problem. In discussion below, I use the terminology for the
can_append
analog; the modifications forcan_prepend
are what you would expect.Since the problem is that
can_append
accepts trajectories that are any subtrajectory, not just the start of a trajectory in the ensemble, the solution is to have new functions that require that the given trajectory actually be the start of a trajectory in the ensemble.Several name options I’ve considered for these functions:
strict_can_append
/strict_can_prepend
can_prefix
/can_suffix
can_be_prefix
/can_be_suffix
Currently, I’m using
strict_*
, because that seemed most natural to me. But if there’s a preference for a different name, that can be changed.For many of the “atomic” ensembles we use to assemble more complicated ensembles (e.g.,
VolumeEnsemble
s,LengthEnsemble
s) this is exactly the same ascan_append
. For most other ensembles (Wrapped
,Combination
, etc), it behaves just likecan_append
, but withstrict_can_append
in place ofcan_append
. However, it does require a separate function for theSequentialEnsemble
. This new function will disallow the possibility of starting from anything other than the first subensemble of the sequence.strict_can_append
/strict_can_prepend
for ensembles other than sequentialstrict_can_*
in ensembles other than sequentialSequentialEnsemble.strict_can_*
SequentialEnsemble.strict_can_*
ensemble.py