Re: [Rdkit-discuss] Suppress stdout and stderr in rdkit

2016-02-18 Thread Gaetano Calabro
Hi Paolo,

Thanks a lot for your prompt reply. I ended up coding this:

from rdkit import Chem
from rdkit import RDLogger

smart = 
'[#6]1(:[#6]:[#6]:[#6]2:[#6](:[#6]:1):[#6]:[#6]:[#6]:[#6]:2)-[#8,#6]'

mol = Chem.MolFromSmarts(smart)

lg = RDLogger.logger()

lg.setLevel(RDLogger.CRITICAL)

try:
 Chem.SanitizeMol(mol)
except:
 print 'OK'


Ciao,

Gaetano


On 02/18/2016 01:09 AM, Paolo Tosco wrote:
> Dear Gaetano,
>
> you may try the following:
>
> from rdkit import rdBase
> rdBase.DisableLog('rdApp.error')
>
> You may check the logging levels you wish to disable/enable in 
> rdkit/RDLogger.py, or use a wildcard such as 'rdApp.*' to affect all 
> levels at once.
>
> Best,
> Paolo
>
> On 17/02/2016 23:54, Gaetano Calabro wrote:
>> from rdkit import Chem
>>
>> smart = 
>> '[#6]1(:[#6]:[#6]:[#6]2:[#6](:[#6]:1):[#6]:[#6]:[#6]:[#6]:2)-[#8,#6]'
>>
>> mol = Chem.MolFromSmarts(smart)
>>
>> Chem.SanitizeMol(mol)
>


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Suppress stdout and stderr in rdkit

2016-02-18 Thread Paolo Tosco
Dear Gaetano,

you may try the following:

from rdkit import rdBase
rdBase.DisableLog('rdApp.error')

You may check the logging levels you wish to disable/enable in 
rdkit/RDLogger.py, or use a wildcard such as 'rdApp.*' to affect all 
levels at once.

Best,
Paolo

On 17/02/2016 23:54, Gaetano Calabro wrote:
> from rdkit import Chem
>
> smart = '[#6]1(:[#6]:[#6]:[#6]2:[#6](:[#6]:1):[#6]:[#6]:[#6]:[#6]:2)-[#8,#6]'
>
> mol = Chem.MolFromSmarts(smart)
>
> Chem.SanitizeMol(mol)


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Suppress stdout and stderr in rdkit

2016-02-17 Thread Gaetano Calabro

Hi there,

I wonder if there is an easy way to suppress the standard output and standard 
error from RDkit. For example:

from rdkit import Chem

smart = '[#6]1(:[#6]:[#6]:[#6]2:[#6](:[#6]:1):[#6]:[#6]:[#6]:[#6]:2)-[#8,#6]'

mol = Chem.MolFromSmarts(smart)

Chem.SanitizeMol(mol)

This will produce the warning message:

[15:52:25] Explicit valence for atom # 3 C, 5, is greater than permitted

I would like to suppress this message. Is there any way to do it?

Thanks,

Gaetano






--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss