[Yt-dev] Numpy warning supression

david collins antpuncher at gmail.com
Mon Aug 15 13:23:01 PDT 2011


I would propose that if you have code that you know is going to throw
an error, you suppress it directly with something like

with warnings.catch_warnings():
  warnings.simplefilter("ignore")
  do_your_thing()

That way unintentional errors, like trying to plot the log of a signed
quantity, won't get killed.  I make dumb errors like that all the
time, so these errors can be useful even if having them actually raise
an exception doesn't work.

d.

On Mon, Aug 15, 2011 at 2:01 PM, Stephen Skory <s at skory.us> wrote:
> Matt,
>
>>> Okay, how about we check the loglevel inside the yt/logger.py module.
>>> If it's set to less than debug, suppress them globally.  Would that
>>> work?
>
> I think that's a good plan.
>
> --
> Stephen Skory
> s at skory.us
> http://stephenskory.com/
> 510.621.3687 (google voice)
> _______________________________________________
> Yt-dev mailing list
> Yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>



-- 
Sent from my computer.



More information about the yt-dev mailing list