Works for me on Windows with latest release of OBPython for 3-methylbutanal taken from: http://blueobelisk.svn.sourceforge.net/viewvc/checkout/blueobelisk/structures/trunk/src/aldehydes/3-methylbutanal.cml
(From the "Submit a bug report" page...) A good bug report should include:
I might have been a bit hasty...when I closed the Python interpreter on Windows, it crashed, which is in agreement with your bug report. Next step is to reproduce on Linux, and trace the problem. It's a problem in the core OpenBabel libray rather than the Python.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm bumping up the priority as I'm going to add CML support as a test for Pybel. Also, here's a better test case for you guys which shows you where the problem is. It fails on both Linux and Windows:
import os
import openbabel
filename = "cs2a.cml"
format = "cml"
obconversion = openbabel.OBConversion()
formatok = obconversion.SetInFormat(format)
if not formatok:
raise ValueError,"%s is not a recognised OpenBabel format" % format
if not os.path.isfile(filename):
raise IOError, "No such file: '%s'" % filename
Is this now fixed? I'm going to mark this as "pending," since I understand that SVN trunk now fixes this.
Noel, if it's still a problem, please post a comment as to what needs fixing and we'll reopen the bug. Otherwise, this should close within 2 weeks as fixed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The remaining problem is with reading multimolecule CML files, and is described in my email of 3 Mar (below). The test case is cmlreadfile.cpp.
"I've just checked in a test for CML scripting support called
cmlreadfile.cpp. Chris has been doing some work and it now works for
single molecule files. However, I find that there is a still a problem
with multimolecule CML files.
Specifically, the test file contains two molecules, but OpenBabel
reads a third empty one. Hopefully, once this is fixed, this unit test
will ensure that it doesn't regress in future."
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For the record, my test case is len(list(pybel.readfile("cml", "3d.head.2.cml"))). The answer should be 2, and that's what I'm getting both on Linux (tested b1 snapshot) and on Windows (tested SVN).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=850620
Originator: NO
Works for me on Windows with latest release of OBPython for 3-methylbutanal taken from:
http://blueobelisk.svn.sourceforge.net/viewvc/checkout/blueobelisk/structures/trunk/src/aldehydes/3-methylbutanal.cml
(From the "Submit a bug report" page...) A good bug report should include:
Logged In: YES
user_id=850620
Originator: NO
I might have been a bit hasty...when I closed the Python interpreter on Windows, it crashed, which is in agreement with your bug report. Next step is to reproduce on Linux, and trace the problem. It's a problem in the core OpenBabel libray rather than the Python.
Logged In: YES
user_id=21420
Originator: NO
Is this still a bug? I don't have problems saving to CML.
Logged In: YES
user_id=850620
Originator: NO
Still a bug. The problem is simply reading from the CML. Verified on Linux (using the SVN trunk r2217) with the following test file:
import pybel
mol = pybel.readfile("cml", "3-methylbutanal.cml").next()
===================
Core dumped. "gdb python core", followed by "bt" gives:
Core was generated by `python test1815533.py'.
Program terminated with signal 11, Segmentation fault.
0 0x00000169 in ?? ()
(gdb) bt
0 0x00000169 in ?? ()
1 0xb773eecf in ~OBConversion (this=0x81e1b70) at obconversion.cpp:253
2 0xb78f7bd3 in _wrap_delete_OBConversion (args=0xb7b1efac)
3 0x0805a84e in PyObject_CallFunctionObjArgs ()
4 0xb78ab5c5 in PySwigObject_dealloc (v=0xb7d90920)
5 0x0807b88f in PyDict_GetItem ()
6 0x0808ba4e in PyType_GenericAlloc ()
7 0x080ff8c8 in PyFrame_Fini ()
8 0x080feea0 in PyDescr_NewMember ()
9 0x080fd57e in PyDictProxy_New ()
10 0x080b6918 in PyEval_EvalFrame ()
11 0x080ba735 in PyEval_EvalCodeEx ()
12 0x080ba799 in PyEval_EvalCode ()
13 0x080dd147 in PyRun_FileExFlags ()
14 0x080dd344 in PyRun_SimpleFileExFlags ()
15 0x08055ba8 in Py_Main ()
16 0x08055032 in main ()
Logged In: YES
user_id=850620
Originator: NO
I'm bumping up the priority as I'm going to add CML support as a test for Pybel. Also, here's a better test case for you guys which shows you where the problem is. It fails on both Linux and Windows:
import os
import openbabel
filename = "cs2a.cml"
format = "cml"
obconversion = openbabel.OBConversion()
formatok = obconversion.SetInFormat(format)
if not formatok:
raise ValueError,"%s is not a recognised OpenBabel format" % format
if not os.path.isfile(filename):
raise IOError, "No such file: '%s'" % filename
obmol = openbabel.OBMol()
notatend = obconversion.ReadFile(obmol,filename)
Noel
Logged In: YES
user_id=21420
Originator: NO
Is this now fixed? I'm going to mark this as "pending," since I understand that SVN trunk now fixes this.
Noel, if it's still a problem, please post a comment as to what needs fixing and we'll reopen the bug. Otherwise, this should close within 2 weeks as fixed.
Logged In: YES
user_id=850620
Originator: NO
The remaining problem is with reading multimolecule CML files, and is described in my email of 3 Mar (below). The test case is cmlreadfile.cpp.
"I've just checked in a test for CML scripting support called
cmlreadfile.cpp. Chris has been doing some work and it now works for
single molecule files. However, I find that there is a still a problem
with multimolecule CML files.
Specifically, the test file contains two molecules, but OpenBabel
reads a third empty one. Hopefully, once this is fixed, this unit test
will ensure that it doesn't regress in future."
Is this still an issue, or can I close the bug?
Looks okay on Windows. Will check later on Linux. - Noel
Looks good on linux. Closing.
For the record, my test case is len(list(pybel.readfile("cml", "3d.head.2.cml"))). The answer should be 2, and that's what I'm getting both on Linux (tested b1 snapshot) and on Windows (tested SVN).