Hello,

I am trying to convert a .cif file to a xyz of the unit cell, using the 
openbabel python bindings. The working CLI that I am trying to implement is:

obabel source.cif  -O output.xyz --fillUC strict

I need to add the "--fillUC strict" option to the conversion in Python (2.7.6) 
. Something like:

import openbabel
obConversion = openbabel.OBConversion()
obConversion.SetInAndOutFormats("cif", "xyz")
obConversion.AddOption("fillUC",openbabel.OBConversion.GENOPTIONS,"strict")
mol = openbabel.OBMol()
obConversion.ReadFile(mol, "source.cif")
obConversion.WriteFile(mol, 'output.xyz')

This produces the same output I would get from the CLI call without the 
"--fillUC strict" option (it seems to be ignoring this). I don't really know if 
I am invoking the AddOption syntax correctly - I have tried various mutations 
of the above syntax without success. Any help would be greatly appreciated!

Best,
JP






------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to