Re: [Rdkit-devel] [ rdkit-Bugs-1932365 ]
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2008-04-09 19:24:51
|
Adrian,
I'm not sure if you get email when the bugs are updated or not, so
I'll go ahead and post. The proposed solution here has been
implemented and checked in:
> On Wed, Apr 2, 2008 at 7:14 PM, Greg Landrum <gre...@gm...> wrote:
> >
> > What about solution A (returning None on parse failure), with messages
> > displayed to stderr using the logging mechanism? I.e. when you'd see
> > something like this:
> > >>> m = Chem.MolFromSmiles('c1cccc1')
> > [TIMESTAMP] Sanitization error: Can't kekulize mol
> > >>> m is None
> > True
The various file parsers (including the suppliers) should no longer
throw exceptions when they fail. They should display error messages
and return None. The exception to this is when the file parsers (or
suppliers) fail to open the input file; in this case you'll get an
IOError, which is the Pythonic (IMO) way of doing things.
Let me know if you have a chance to try it and find any problems,
-greg
|