-
Notifications
You must be signed in to change notification settings - Fork 2
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
Sampler #17
Sampler #17
Conversation
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.
Some small comments, looks mostly fine to me.
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.
I like most of the changes, but I'm not happy with how you seed the random generator. You should seed it only once, at the start of your process. Otherwise your seeded random will not be random enough.
You can also, for reproducibility, generate a seed if None is given (time.time_ns()
) and log that somewhere the user can find it.
…onvention used in cgsmiles
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.
For the Sampler examples, I'm not super clear on what the difference between *reactivities and *probabilities is. Also, for some examples you do from_string
, for other from_fragment_string
. Is this intentional?
Lastly, does it make sense to completely replace the terminal logic with the fragment reactivities?
@pckroon All reactivities are probabilities. Reactivities is used when the decision is based on a bonding descriptor. I've added a clarification in the docs. they should all be Not entirely because at the CG level branch termination cannot be determined by the bonding descriptor when no end-group is added. Otherwise, yes one could do as suggest. Of course one other option is to simply define an empty or fake terminal. But not sure that makes it easier. |
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.
Thanks for the clarification. The docstring(s) also help me :)
Still found a typo though.
As for the terminals, I don't have a super strong preference for one or the other. I just know from experience that the more complex an API is, the harder it is to use. It requires more mental space to keep track of all the arguments, their different formats/types/conventions, and how it all interacts.
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.
Still found some small points :)
Co-authored-by: Peter C Kroon <[email protected]>
Initial draft for a sampler class that takes fragments and makes random molecules according to bonding probabilities