|
From: Geoffrey H. <ge...@ge...> - 2006-06-30 20:51:08
|
On Jun 30, 2006, at 2:45 PM, S Joshua Swamidass wrote:
> So here is an interactive session which displays the unusability of
> OBTypeTable: I think the problem lyes in the Translate method.
That might not be a bad idea, but the current code works just fine.
If you're looking for examples, you should take a look at the various
file format translators, e.g., src/format/tinkerformat.cpp.
In general, the current code doesn't use exceptions. Historically, it
hasn't always been well supported by
>>>> ttab.Translate('1','1')
> ==============================
> *** Open Babel Warning in Translate
> Cannot perform atom type translation: table cannot find requested
> types.
> False
Yes, but "1" isn't a valid INT atom type. (Check data/types.txt if
you're curious) I'm also not sure what Python thinks about returning
something into the constant string '1'.
How about:
ttab.Translate(dest, "C3")
I bet that works. Check dest for the output.
-Geoff
|