Bug 194599 - science/openbabel: 2.3.2 Python binding pybel does not recognize supported formats
Summary: science/openbabel: 2.3.2 Python binding pybel does not recognize supported fo...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: Normal Affects Only Me
Assignee: Yuri Victorovich
URL: https://github.com/openbabel/openbabe...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-25 19:12 UTC by ftorazyne
Modified: 2018-10-14 18:16 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ftorazyne 2014-10-25 19:12:14 UTC
Function readstring() from OpenBabel 2.3.2 Python binding pybel does not recognize any supported format - 'smi','pdb' etc. Code like a

import pybel 
mymol=pybel.readstring('smi','CCOC(=O)C') 
mymol.addh() 
mymol.make3D() 
print mymol.write(format='mol2') 

receives this error: 

Traceback (most recent call last): 
 File "./test.py", line 6, in <module>
 mymol=pybel.readstring('smi','CCOC(=O)C') 
 File "/usr/local/lib/python2.7/site-packages/pybel.py", line 179, in readstring 
 raise ValueError("%s is not a recognised Open Babel format" % format) 
ValueError: smi is not a recognised Open Babel format 

But pybel.informats contain 'smi' key: 

>>> import pybel 
>>> print sorted(pybel.informats) 
['CONFIG', 'CONTCAR', 'HISTORY', 'POSCAR', 'VASP', 'abinit', 'acesout', 'acr', 'adfout', 'alc', 'arc', 'axsf', 'bgf', 'box', 'bs', 'c09out', 'c3d1', 'c3d2', 'caccrt', 'can', 'car', 'castep', 'ccc', 'cdx', 'cdxml', 'cif', 'ck', 'cml', 'cmlr', 'crk2d', 'crk3d', 'ct', 'cub', 'cube', 'dat', 'dmol', 'dx', 'ent', 'fa', 'fasta', 'fch', 'fchk', 'fck', 'feat', 'fhiaims', 'fract', 'fs', 'fsa', 'g03', 'g09', 'g92', 'g94', 'g98', 'gal', 'gam', 'gamess', 'gamin', 'gamout', 'got', 'gpr', 'gro', 'gukin', 'gukout', 'gzmat', 'hin', 'inchi', 'inp', 'ins', 'jout', 'log', 'mcdl', 'mcif', 'mdl', 'ml2', 'mmcif', 'mmd', 'mmod', 'mol', 'mol2', 'mold', 'molden', 'molf', 'moo', 'mop', 'mopcrt', 'mopin', 'mopout', 'mpc', 'mpo', 'mpqc', 'mrv', 'msi', 'nwo', 'out', 'outmol', 'output', 'pc', 'pcm', 'pdb', 'pdbqt', 'png', 'pos', 'pqr', 'pqs', 'prep', 'pwscf', 'qcout', 'res', 'rsmi', 'rxn', 'sd', 'sdf', 'smi', 'smiles', 'sy2', 't41', 'tdd', 'text', 'therm', 'tmol', 'txt', 'txyz', 'unixyz', 'vmol', 'xml', 'xsf', 'xyz', 'yob']

It was established in discussion at OpenBabel forum (http://forums.openbabel.org/Error-in-Pybel-readstring-smi-format-not-recognized-td4657776.html) that function OBConversion.SetInFormat from openbabel.py returns "False" for any format specificator whenever it is supported or not.

I should underline, that OpenBabel was installed from port, i.e. was compilied from sources at my machine, and I do not use any pre-compilied OpenBabel binaries. I used gcc4.2 and gcc4.8.
Comment 1 John Marino freebsd_committer 2014-11-01 12:38:18 UTC
The auto-assigner couldn't figure out who to assign the PR too because the port origin wasn't in the title.  Updating title and manually assigning to maintainer.
Comment 2 Yuri Victorovich freebsd_committer 2017-05-18 06:08:01 UTC
Confirmed in 2.4.1.
Comment 3 Walter Schwarzenfeld freebsd_triage 2018-01-14 04:14:03 UTC
Maintainer feedback?
Comment 4 Yuri Victorovich freebsd_committer 2018-10-14 18:16:44 UTC
This is really an upstream problem, has nothing to do with FreeBSD.