-
Notifications
You must be signed in to change notification settings - Fork 129
Disallow redundant bonds in BondList
#829
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
base: main
Are you sure you want to change the base?
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.
A check for same atom binding to itself was added to both the BondList constructor and add_bond method.
BondList
Addresses first part of #812 |
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 fix. However, I see a problem with the performance: Iterating over bonds
directly happens in pure Python, which can be quite time consuming. Hence I'd rather suggest to use a memoryview
instead which cython
compiles into C code.
Are you familiar with these Cython details? Otherwise I also can make the amendments here.
Yes please. This PR only addresses the first part. The second part regarding the chem_comp bond will be in a separate PR as you suggested and I will be push soon |
I am not familiar with the Cython details but I would be glad if you could brief me on them so I implement the suggestion myself and get to learn it as well |
Meanwhile, I am reading about the change you suggested. Would get back with the revised amendments |
…ad of directly iterating over bonds in pure Python.
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.
Added iteration over bonds with memoryview instead of pure Python
Sorry for the late response, I was sick for a few days. I think these two tutorial pages give a sufficient overview of Cython's memory views: https://cython.readthedocs.io/en/latest/src/userguide/numpy_tutorial.html If you look at
It tells Cython to convert |
I'm much glad you're fit again. I'm going through the tutorials |
No description provided.