Old Biboroku

Tuesday, December 28, 2010

Suppressing Warnings in PyFITS

Filed under: Misc. — nomo17k @ 22:19
Tags: , , ,

Moved.

 

2 Comments »

  1. This is nice, but wouldn’t you catch all existing warnings with this method, and then *ingore* other possible warning due to other situations?

    Comment by DavidR. — Wednesday, December 29, 2010 @ 14:26 | Reply

    • DavidR. — Might be true about other possible warnings, if it happens within the writeto method. But for crucial messages (which might be dangerous to keep going with the execution) they should really use exceptions, not warnings. However, the beauty of the “with” statement I think is that the scope of the “ignore” gets limited within that particular block. So you don’t have to redefine all the filters afterward to catch other warnings. That’s why the “with” statement can be a neat solution, I think.

      Comment by nomo17k — Wednesday, December 29, 2010 @ 15:02 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.