Hi there,
I have been using avogadro 0.8.x as packaged by debian.
Recently I have upgraded to 0.9.2 as it became available in debian
testing. From 0.8.x to 0.9.x the programming interface has
signifficantly changed and I’ve been trying to adapt my
0.8.x python extension scripts. However, it hasn’t been a
trivial task.
I have been having extreme difficulty on doing such basic
things as getting the coordinates of a molecule’s atom.
As an example of the problems I include as attachment to this
email a script were I attempt to simply do this iteration:
for bond in mol.bonds:
beginAtom = mol.atomById(bond.beginAtomId)
endAtom = mol.atomById(bond.endAtomId)
that I found in the example engine python script wireframe.py
which is included in the avogadro distribution. This wireframe.py
script does work, but mine fails with the message:
Traceback (most recent call last):
File “/home/ajpalace/.avogadro/extensionScripts/MyTest.py”, line 45,
in performAction
for bond in mol.bonds:
TypeError: ‘property’ object is not iterable
What is wrong?
I also include a similarly simple second script, this time with
an iteration over mol.atoms which fails with a similar message.
I have been having quite some trouble in running python scripts
with the new 0.9.x versions! First, I now that is not your fault
but the debian package does not include the Avogrado.so file that
has the python module library!!! It took me some time until I found
out why no python scripts appeared in the menu.
I had to recompile the debian source and get this file from it.
Afterwards I could now get the examples provided with the distribution
but could not run my own scripts. I mean, I could run them but with
these error messages.
I eventually removed the debian packages and compiled the avogadro
source downloaded directly from your site. But the problem, as I
described it, persists.
Now, what I would like to know is if the python module has been tested
with user scripts and is currently working with everybody else, meaning
that there is specifically a problem with my system, and if you
could check on the examples I am including in this message to see
if I am doing anything wrong (I don’t think I am!).
Thank you very much.
Apart from the problems I am having to run python scripts under
the 0.9.x versions, I have been enjoying this program very much.
Congratulations and thanks for your work on avogadro.
Cheers,
Alfredo