Create Header instance when _BasicHeader fails#9711
Conversation
|
The failure |
8d49163 to
728a952
Compare
|
The issue is that astropy/astropy/io/fits/tests/test_fitsdiff.py Lines 226 to 228 in 61b3a18 So I fixed this issue in fitsdiff, even if I'm not too happy with putting another fix in this PR, I don't know how to proceed otherwise. |
|
Failure is unrelated ( |
|
Re: CacheDamaged -- FWIW a rebase would get rid of it, as we have temporarily skipped the test. |
125e015 to
4318fb5
Compare
_BasicHeader does not support assignment, with the assumption that HDU classes should not need to modify the header at instantiation. This has been true until now, with one exception (astropy#9193) that has been fixed by another mean. The problem addressed here is that GroupsHDU needs to modify the header to handle some invalid header (astropy#9709). So in this case we fall back to creating a normal Header instance.
|
One unrelated failure in the 32 build, after rebasing : |
4318fb5 to
d7ff06b
Compare
|
I think it happens because this is the parallelized build, and |
|
So I fixed the changelog, it should be good now. @MSeifert04 seems busy, so maybe @astrofrog or @mhvk you can give it an eye ? 🙏 |
mhvk
left a comment
There was a problem hiding this comment.
As a work-around, this is fine, but can you add a comment in base.py why this is done? After all, it is a rather ugly hack and really something that hdu should not have to know about (but then, it also shouldn't be modifying a header!). A comment might just trigger someone willing to really think through how to separate the parts a bit better...
p.s. I just had quite a long look at all these files in order to implement PSRFITS in our package, and was already very confused about this data=DELAYED part, and was rather thankful for the liberally sprinkled comments through the files!
|
@mhvk - Yes you are right, I will add a comment! |
|
@mhvk - Done, please have a look. I skipped the CI since this is just a comment change. |
|
Thanks, I think that is really helpful and clear. Merging... |
Create Header instance when _BasicHeader fails
Fix #9709 :
_BasicHeaderdoes not support assignment, with the assumption that HDU classes should not need to modify the header at instantiation. This has been true until now, with one exception (#9193) that has been fixed by another mean.The problem addressed here is that
GroupsHDUneeds to modify the header to handle some invalid header (#9709). So in this case we fall back to creating a normalHeaderinstance. I wanted to avoid this because of the performance penalty but here it is limited to specific cases (e.g. invalid headers). And it was useful to not have this from the start, since it was a good mean to find edge cases like this one :)