question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move Yank class away from parsing and forwarding options to other classes

See original GitHub issue

Since 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:closed
  • Created 7 years ago
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
pgrinawaycommented, Nov 16, 2016

Oh, sorry, totally confused that with the expanded ensemble concept. Nevermind then…

1reaction
andrrizzicommented, Nov 16, 2016

But in the case of SAMS, aren’t we integrating both?

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python-ev3dev Documentation
New classes are available for coordinating motors: ev3dev2.motor. ... the way to the top of the circle we want both motors to move...
Read more >
readline(3) - Linux manual page
This will search backward or forward in the history for the next line matching the search string typed so far. Any other key...
Read more >
Bash Reference Manual
The shell then parses these tokens into commands and other constructs, removes the special meaning of certain words or characters, expands ...
Read more >
Sorc buffs and nuking PvP opponents from complete safety
That said, Sorc needs buffs, and the tank meta needs to die. ... give up their shields have equivalent healing options to every...
Read more >
Modern IDEs are magic. Why are so many coders still ...
Vim and Emacs users, once at each other's throats, seem to have implemented each other's keybindings (a thing they actually do) to take...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found