julien
unread,Nov 28, 2012, 9:37:05 AM11/28/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sire-de...@googlegroups.com
Hi Chris,
I would like to expose the class MoleculeData to Python so that I can write in a script this line of code
newmol_coords = AtomCoords( mol.data().info() )
The idea is to get an atomcoords object initialised with the correct number of cut groups present in the molecule mol.
I can then update the coordinates of the atoms using
newmol_coords.set( cgatomidx, atom_coord)
and eventually edit mol to use newmol_coords as a property("coordinates")
At the moment I cannot simply type mol.data().info() in a python script
--> 328 newmol_coords = AtomCoords( mol.data().info() )
329 print "Processing molecule %s natoms %s " % ( molnum.value(), molnatoms )
330 for x in range(0,molnatoms):
TypeError: No to_python (by-value) converter found for C++ type: SireMol::MoleculeData
The fix would be (I think) to expose MoleculeData and MoleculeInfoData to python
In moleculedata.h I have added the following line of code
SIRE_EXPOSE_CLASS(SireMol::MoleculeData)
And recompiled the C++ code and Python wrapper.
However compilation of the wrappers fails with the following error message
CMakeFiles/Mol.dir/MoleculeData.pypp.cpp.o: In function `register_MoleculeData_class()':
MoleculeData.pypp.cpp:(.text+0x73b): undefined reference to `SireMol::MoleculeData::assertHasMetadata(SireBase::PropertyName const&) const'
MoleculeData.pypp.cpp:(.text+0x888): undefined reference to `SireMol::MoleculeData::assertHasMetadata(SireBase::PropertyName const&, SireBase::PropertyName const&) const'
MoleculeData.pypp.cpp:(.text+0x959): undefined reference to `SireMol::MoleculeData::assertHasProperty(SireBase::PropertyName const&) const'
The folder sire/python2/Mol/ contains the python script special_code.py . Is it possible that this script has to be modified to correctly wrap the above three methods? If so...is there a specific fix_XXXX function in that script that I could adapt for this purpose?
Thanks,
Julien