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
Deprecate automatic changes to the tile size with HCOMPRESS_1 #14410
Deprecate automatic changes to the tile size with HCOMPRESS_1 #14410
Conversation
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
CI failures should go away if you rebase. I am surprised no tests are affected by this change. |
I don't think there were any tests of this 'feature' |
👍 for deprecating and raising an error in the future. There are now some conflicts to resolve. |
0ca6357
to
692dd41
Compare
@saimn - rebased and ready for final review once you are back :) |
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.
LGTM, thanks @astrofrog.
When creating a
CompImageHDU
with a tile size that results in tiles having <4 pixels along one or more dimensions, the tile size is automatically and silently updated - but only if it can be changed by adding +1 to one of the dimensions:If the tile size cannot automatically be adjusted, an error is raised:
The auto changing is confusing IMHO as it only works in very specific cases (it would have to be that adding 1 makes the tile size acceptable, not removing 1 or not adding 2) and I think we should simply deprecate and eventually remove this behavior in favor of always raising an explicit error, so this PR is to add a deprecation warning to that effect - but this is just a suggestion, I'm happy to be told that the above behavior is desirable! With this PR:
Note that a side effect of the current behavior is that tuples cannot be passed for the tile size which is also confusing: