Hi Lorenzo,
Looks like the cmd.bond() function is indeed very inefficient. I've found a "TO
DO: optimize for performance" comment in the code - that speaks for itself.
https://github.com/schrodinger/pymol-open-source/blob/master/layer2/ObjectMolecule.cpp#L4492
Parallelization is not the solutio
Hi Blaine,
Thanks for your help.
I don't think what you suggest is going to solve the problem. The loop
itself is quite fast, and I don't need to perform anything else in the loop
other than adding those bonds.
I already have a list of tuples [(atom1, atom2), (atom3, atom4)] and all I
need to do i
Hi Lorenzo,
You can import numpy and replace your lists of coordinates with NumPy arrays.
Operations with numpy arrays can be >100 times faster than with lists in for
loops.
See the last example the following blog post for inspiration:
https://medium.freecodecamp.org/if-you-have-slow-loops-i