Move Yank class away from parsing and forwarding options to other classes
See original GitHub issueSince all the relevant objects are initialized inside Yank
(i.e. restraint, alchemical factory, sampling class), we need to pass all the parameters for all classes in a big kwargs
dictionary. Then Yank
has to use introspection to separate them by class to initialize all the objects correctly. I propose to make an effort to move the initialization of these objects outside Yank
.
From a user perspective, the final interface would become something like
sampler = ModifiedHamiltonianExchange(**sampler_options)
factory = AlchemicalFactory(**alchemical_options)
restraint = Harmonic(**harmonic_options)
yank = Yank(store_directory, sampler, factory, **yank_options)
yank.create_phases(thermodynamic_state, restraint, *alchemical_phases)
This is of course only to give an idea, not an actual proposal, but I would implement the restraint part this way now, if we agree that the API should move towards this direction before 1.0 release. I realize that we may need to change a lot of things for this to happen, but I really believe this will turn out to be much easier to maintain and extend in the future.
Question: do we want to attach restraints to phases and then simply perform checks to determine if the restraint is appropriate for that type of phase (i.e. raise an exception if it’s not a complex), or pass only a single restraint
argument for all phases and adding the restraint automatically (as we currently do)?
Issue Analytics
- State:
- Created 7 years ago
- Comments:22 (22 by maintainers)
Top GitHub Comments
Oh, sorry, totally confused that with the expanded ensemble concept. Nevermind then…
Sorry for the confusion, by “expanded state” here I mean the system with an enlarged cutoff that we use to reweight our samples to correct for anisotropic long-range dispersion interactions.