-
Notifications
You must be signed in to change notification settings - Fork 667
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
Fix bond deletion #4763
Fix bond deletion #4763
Changes from 6 commits
46f5b15
5485b02
0f1b83e
64be27b
367e2c4
560ad70
fa68282
c64627e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,7 +146,7 @@ def parse(): | |
struc = parse() | ||
|
||
assert hasattr(struc, 'bonds') | ||
assert len(struc.bonds.values) == 4 | ||
assert len(struc.bonds.values) == 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These used to be bonds between [(0, 1), (0, 1), (1, 2), (1, 2)] -- so two bonds repeated. This change makes it so each bond is unique. |
||
|
||
|
||
def test_single_conect(): | ||
|
@@ -158,7 +158,7 @@ def parse(): | |
with pytest.warns(UserWarning): | ||
struc = parse() | ||
assert hasattr(struc, 'bonds') | ||
assert len(struc.bonds.values) == 2 | ||
assert len(struc.bonds.values) == 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to above. |
||
|
||
|
||
def test_new_chainid_new_res(): | ||
|
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.
This change is likely the culprit - doing a
not in
operation on a list is orders of magnitude slower than on a set.Example:
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 removed this in the commit below, but note to self that changing
self.values
to a dict might be the easiest way to do this performantly and retain both uniqueness and order.Or masking the input
values
after checking aset
version ofself.values
might be less work but still more performant.