-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add new restraints Application layer interface #1038
Conversation
* Added new `restraints` block to the YAML * Exactly the same as it used to be in `experiments` block but with unique ID string * Added new `name` key which can be used to target custom `lambda_name` variables, optional and defaults to `restraints`. Non-unique to let multiple restraints be controlled by same variable. * Block is 100% optional * `experiments` block allows `restraint: target` to target restraint in `restraints` block. * Supports old style to preserve backwards compatibility * Supports targeting a single restraint from the `restraints` block * Supports a list of targets in the `restraints` block to use multi-restraints * Updated and added tests for new application layer feature * Note: Tests should pass but there is no underlying mechanism to use this yet * Updated docs * New `restraints` doc page * Updated `experiments` page with behavior changes to the `restraint` keyword * Updated index pages to include new page and pointers. A key thing: These application layer changes should be 100% compatible with the older versions. So we should not have to have users change their YAML files like we did with the MultiStateSampler conversion. That said, this is still a major new feature and the start of the 0.24.0 release.
Thanks for taking a stab at this, @Lnaden! When extending the YAML syntax, it helps to add some concrete examples instead of just defining the schemas. Could you draft an example YAML file that illustrates the new structure you envision here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Let's make sure to remove the line that pops the name
out of the restraint constructor once we add the feature.
Ah! Actually, I think this PR has the same fault as the |
@Lnaden: Repeating this here, since I think it was overlooked: Could you draft an example YAML file that illustrates the new structure you envision here? The PR doesn't include an actual example of what you are envisioning the new YAML syntax to look like for a real project that uses this feature. |
I was including this in the cookbook changes I was doing as well. Sorry for not explicitly mentioning it here! |
That's on purpose. It puts the name right back on it after it calls the constructor.
Good catch, I'll fix that |
I meant that when |
|
Thats also why I am proposing this into the |
Output YAML now includes samplers, mcmc_moves, and restraints blocks (Fixes #947) Fixed typo in copy pate of the mcmc example
I have made a couple changes to this part of the multi-restraints. @jchodera I have added a hard example YAML showing the new format here as part of the docs @andrrizzi I should have fixed #947 with this, could you please review the diff and make sure it looks good to you? This will include the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Yank/experiment.py
Outdated
|
||
# Export YAML into a file | ||
import pdb; pdb.set_trace() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found it :) !
I always miss the 1. Thank you! |
Note: This PR is being merged into the new
multirestraint
branch. Much like the SAMS/MultiStateSampler branch, I wanted to make a branch we can all work on that is not master as we start this process, comment, and review as we would normal PRs. I have not configured travis to run on this branch yet, but my local tests are passing.restraints
block to the YAMLexperiments
block but with unique ID stringname
key which can be used to target customlambda_name
variables, optional and defaults torestraints
. Non-unique to let multiple restraints be controlled by same variable.experiments
block allowsrestraint: target
to target restraint inrestraints
block.restraints
blockrestraints
block to use multi-restraintsrestraints
doc pageexperiments
page with behavior changes to therestraint
keywordA key thing: These application layer changes should be 100% compatible with the older versions. So we should not have to have users change their YAML files like we did with the MultiStateSampler conversion. That said, this is still a major new feature and the start of the 0.24.0 release.