-
Notifications
You must be signed in to change notification settings - Fork 81
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
Force Overlap Results in Missing Adjacencies #1048
Comments
If you use print adjacencies on the defunct
Whereas the correctly made one looks like:
|
This also results in an incorrect bondgraph, so it is in the add_bond method. ch3 = mb.lib.moieties.CH3()
ch3_2 = mb.lib.moieties.CH3()
ch3.add_bond((ch3[0], ch3_2[0]))
ch3.add(ch3_2)
get_missing_edges(ch3)
print_adjacencies(ch3)
|
Okay so here looks to be the issue. When adding a bond, using the self.root.bond_graph.add_edge(particle_pair[0], particle_pair[1]) Then, when the self.add() method is called to add that moiety to the compound, only the atom that has had the bond added to it is part of the main compound bond graph. Following this line in the (adj[node].add(neighbor) for neighbor in neighbors) This should add the other members of the original bond_graph to the set. However, this doesn't work in one line for loops. x = [1,2,3,4,5,1]
y = set()
(y.add(val) for val in x)
print("Try 1:", y)
x = [1,2,3,4,5,1]
y = set()
[y.add(val) for val in x]
print("Try 2: ", y) Output:
|
Fixed by #1049 |
Bug summary
What were you trying to do and what happened instead? Please copy and paste the stack output
When converting to GMSO, the bond graph adjacencies are necessary to evaluate the definitions of molecules.
Code to reproduce the behavior
Please include a code snippet that can be used to reproduce this bug.
Output
Software versions
python -c "import mbuild as mb; print(mb.__version__)"
)0.15.0
python --version
)?3.8
MacOS
The text was updated successfully, but these errors were encountered: