Re: [Rdkit-discuss] Warning as error

2019-01-21 Thread Jean-Marc Nuzillard
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-

Re: [Rdkit-discuss] Warning as error

2019-01-21 Thread Dimitri Maziuk via Rdkit-discuss
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

Re: [Rdkit-discuss] Warning as error

2019-01-21 Thread Jean-Marc Nuzillard
#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>>

Re: [Rdkit-discuss] Warning as error

2019-01-21 Thread Lukas Pravda
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

Re: [Rdkit-discuss] Warning as error

2019-01-21 Thread Stephen O'hagan
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

Re: [Rdkit-discuss] Warning as error

2019-01-21 Thread Markus Sitzmann
-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: > >

Re: [Rdkit-discuss] Warning as error

2019-01-21 Thread Jean-Marc Nuzillard
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

Re: [Rdkit-discuss] Warning as error

2019-01-21 Thread Stephen O'hagan
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:        

[Rdkit-discuss] Warning as error

2019-01-21 Thread Jean-Marc Nuzillard
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?