Each molecule has the _Name I gave it.
Thank you for suggesting to interleave molecule indexes (or names)
with warning messages redirected to unbuffered stderr. It works.
I will use the trick together with Lukas (Thanks!) idea of redirecting
stderr
for in-script processing.
All the best,
Jean-
On 1/21/19 1:42 PM, Jean-Marc Nuzillard wrote:
> sys.stderr.write("Bad: %s\n" % (mol.GetProp("_Name"),))
> I know which bond has a problem but I still do not know in which molecule.
Are you sure they all have _Name's? I'd just print the count outside of
the try/catch block and ignore
#x27;Hagan,
>
>
> -Original Message-
> From: Jean-Marc Nuzillard [mailto:jm.nuzill...@univ-reims.fr
<mailto:jm.nuzill...@univ-reims.fr>]
> Sent: 21 January 2019 12:33
> To: RDKit Discuss mailto:rdkit-discuss@lists.sourceforge.net>>
Hi Jean-Marc,
Just a thought, but SDMolSupplier has a lazy eval, if I am not mistaken.
Technically you should get all the rdkit warnings and errors at the time of
processing that bit of the sdf file. You can always read the stderror output,
parse it and throw exception every time a 'funny' mole
None:
Not sure how to capture the actual warning message.
Dr. Steve O'Hagan,
-Original Message-
From: Jean-Marc Nuzillard [mailto:jm.nuzill...@univ-reims.fr]
Sent: 21 January 2019 13:24
To: RDKit Discuss
Subject: Re: [Rdkit-discuss] Warning as error
My
-Original Message-
> > From: Jean-Marc Nuzillard [mailto:jm.nuzill...@univ-reims.fr]
> > Sent: 21 January 2019 12:33
> > To: RDKit Discuss
> > Subject: [Rdkit-discuss] Warning as error
> >
> > Dear all,
> >
> > The minimalist python code:
> >
ean-Marc Nuzillard [mailto:jm.nuzill...@univ-reims.fr]
Sent: 21 January 2019 12:33
To: RDKit Discuss
Subject: [Rdkit-discuss] Warning as error
Dear all,
The minimalist python code:
reader = Chem.SDMolSupplier('my_file.sdf')
for mol in reader:
pass
gives me warning messages
ginal Message-
From: Jean-Marc Nuzillard [mailto:jm.nuzill...@univ-reims.fr]
Sent: 21 January 2019 12:33
To: RDKit Discuss
Subject: [Rdkit-discuss] Warning as error
Dear all,
The minimalist python code:
reader = Chem.SDMolSupplier('my_file.sdf')
for mol in reader:
Dear all,
The minimalist python code:
reader = Chem.SDMolSupplier('my_file.sdf')
for mol in reader:
pass
gives me warning messages when run on a particular SD file.
How can I simply run a specific action for the molecules that cause problem,
possibly using try/catch statements?
9 matches
Mail list logo