Add cap hydrogens to head and tail compounds in the polymer builder #1196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary:
This is a small PR that changes how the capping hydrogen compounds are added to the polymer that is built up in the polymer builder. Right now, we add the hydrogen compounds to the polymer compound, so they are at the same hierarchical level as the monomer compounds. This PR now adds them to the head and tail monomers. This is cleaner, and creates a more consistent hierarchy that we would expect with a polymer compound, where its children are the monomers, instead of particles. You can see in these 2 examples below:
Current behavior:
Behavior in this PR:
Side note:
This also has a quick fix for a flaky unit test that seems to have some inconsistent behavior (
test_get_smiles
). This test seems to randomly fail, but not because the behavior is wrong, but because sometimes different (but structurally identical) SMILES strings are being returned.