From: Adam T. <a-t...@st...> - 2006-11-27 01:26:58
|
Anyone have pointers on how to use the OBMol.Rotate() function from Python? I tried passing a list of 9 doubles, but got the error "NotImplementedError: No matching function for overloaded 'OBMol_Rotate' ". Any help would be appreciated. Adam |
From: Noel O'B. <bao...@gm...> - 2006-11-28 09:45:57
|
Hello again Adam! You're right. With the latest SWIG and on Windows, I get a slightly more helpful error message: Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python24\Lib\site-packages\openbabel.py", line 1959, in Rotate def Rotate(*args): return _openbabel.OBMol_Rotate(*args) NotImplementedError: Wrong number of arguments for overloaded function 'OBMol_Ro tate'. Possible C/C++ prototypes are: Rotate(double const [3][3]) Rotate(double const [9]) Rotate(double const [9],int) Overloaded functions are not the problem. The problem is that there is no easy way to pass a C array as a parameter. I think the answer can be found in: http://www.swig.org/Doc1.3/Python.html#Python_nn41 In short, either mol.cpp or openbabel-python.i needs to be edited to be some new functionality. Noel On 27/11/06, Adam Tenderholt <a-t...@st...> wrote: > Anyone have pointers on how to use the OBMol.Rotate() function from > Python? I tried passing a list of 9 doubles, but got the error > "NotImplementedError: No matching function for overloaded > 'OBMol_Rotate' ". Any help would be appreciated. > > Adam > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Noel O'B. <bao...@gm...> - 2006-11-28 10:38:24
|
It may also be possible to create a C array directly from python as described in: http://www.swig.org/Doc1.3/Python.html#Python_nn48 http://www.swig.org/Doc1.3/Library.html#Library_nn5 This is probably a better option than that described in my previous email. Noel On 28/11/06, Noel O'Boyle <bao...@gm...> wrote: > Hello again Adam! > > You're right. With the latest SWIG and on Windows, I get a slightly > more helpful error message: > > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "C:\Python24\Lib\site-packages\openbabel.py", line 1959, in Rotate > def Rotate(*args): return _openbabel.OBMol_Rotate(*args) > NotImplementedError: Wrong number of arguments for overloaded function 'OBMol_Ro > tate'. > Possible C/C++ prototypes are: > Rotate(double const [3][3]) > Rotate(double const [9]) > Rotate(double const [9],int) > > Overloaded functions are not the problem. The problem is that there is > no easy way to pass a C array as a parameter. I think the answer can > be found in: > http://www.swig.org/Doc1.3/Python.html#Python_nn41 > > In short, either mol.cpp or openbabel-python.i needs to be edited to > be some new functionality. > > Noel > > > On 27/11/06, Adam Tenderholt <a-t...@st...> wrote: > > Anyone have pointers on how to use the OBMol.Rotate() function from > > Python? I tried passing a list of 9 doubles, but got the error > > "NotImplementedError: No matching function for overloaded > > 'OBMol_Rotate' ". Any help would be appreciated. > > > > Adam > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share your > > opinions on IT & business topics through brief surveys - and earn cash > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > OpenBabel-scripting mailing list > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > |
From: Noel O'B. <bao...@gm...> - 2006-11-29 14:02:38
|
The fix (or workaround) is in SVN now. Seems to work on Linux at least. You can use: c_dbl_array = double_array(mylist) and then pass c_dbl_array to the OBMol.Rotate() method. Noel. On 27/11/06, Adam Tenderholt <a-t...@st...> wrote: > Anyone have pointers on how to use the OBMol.Rotate() function from > Python? I tried passing a list of 9 doubles, but got the error > "NotImplementedError: No matching function for overloaded > 'OBMol_Rotate' ". Any help would be appreciated. > > Adam > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |