-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent warnings about HIERARCH with CompImageHeader class #11404
Conversation
I'm not entirely sure how to test for "this thing did not warn". There are plenty of examples for warnings being issued. Do I do something like:
? |
The global warning config for Lines 115 to 141 in aed5138
With this setup, if you do nothing, all unexpected warnings, except those globally ignored, will turn into an exception. So, if you want to test that something should not raise a warning, no special code is needed. But be careful if the warning you are interested in is already ignored by If you want to make sure your code is raising the correct warning, use |
I've pushed a test. The failure is the samp one again. |
Don't worry about the |
In that case I think it's better to test explicitly that no warning were raised, which can be done with |
4d0a037
to
1f7ed59
Compare
I've updated the test as requested above. I assume the documentation failure is nothing to do with this change. |
Yeah, matplotlib 3.4.0 release last night broke RTD. |
070261b
to
bdb45eb
Compare
Thanks for the fix. Looks good to me! |
Looks good to me too. @timj - could you rebase on master and add a changelog entry as described in https://github.com/astropy/astropy/blob/master/docs/changes/README.rst ? Thanks. |
bdb45eb
to
563af39
Compare
I've rebased and added a change log entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @timj!
Description
Compressed image headers warn when you try to assign a HIERARCH keyword but normal image headers don't.
The underlying problem is that
Card.keyword
strips the HIERARCH and CompImageHeader tries to reconstruct a Card from the keyword of that card. I fix it by checking if the Card itself starts with HIERARCH already and reapply it.This pull request is to address #11403
Fixes #11403