Hi Terry, It is much faster to unpack PyLists than PySequences, which is why the input needs to be a list. However, I just added some code to automatically convert tuples to lists at the Python API level in future PyMOL builds.
Thanks for pointing out this potential CGO "gotcha"! Cheers, Warren -- Warren L. DeLano, Ph.D. Principal Scientist . DeLano Scientific LLC . 400 Oyster Point Blvd., Suite 213 . South San Francisco, CA 94080 USA . Biz:(650)-872-0942 Tech:(650)-872-0834 . Fax:(650)-872-0273 Cell:(650)-346-1154 . mailto:[email protected] > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of > Terry Jones > Sent: Monday, May 29, 2006 5:04 AM > To: [email protected] > Cc: [email protected] > Subject: [PyMOL] Lists vs Tuples inconsistency in cmd.load_cgo() > > I spent quite a bit of time last night chasing down the > following. This: > > cmd.load_cgo([SPHERE, 0.0, 0.0, 0.0, 1.0], 'a') > > puts a sphere on the screen as expected. But this: > > cmd.load_cgo((SPHERE, 0.0, 0.0, 0.0, 1.0), 'a') > > seemingly has no effect at all. I.e., if you pass a tuple > instead of a list, your CGO is not displayed. It's an easy > mistake to make (supposing it should be called a mistake), > and it's not easy to figure out why your CGO does not appear. > > The reason seems to be an if(PyList_Size(pycgo) test on line > 440 of layer2/ObjectCGO.c in the 0.99 release - at least > that's as far as I went in tracing this. > > Is there any reason why a tuple cannot be used here too? > > Regards, > Terry > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost > and Risk! > Fully trained technicians. The highest number of Red Hat > certifications in the hosting industry. Fanatical Support. > Click to learn more > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729& dat=121642 > _______________________________________________ > PyMOL-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/pymol-users > > > >
