Skip to content

Commit

Permalink
Updated warning and added news fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Feb 17, 2023
1 parent 9445c4a commit 4556b49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 6 additions & 5 deletions astropy/io/fits/hdu/compressed.py
Expand Up @@ -1129,11 +1129,12 @@ def _update_header_data(
)

if tile_size != original_tile_size:
warnings.warn(f"The data size should be a multiple of the tile "
f"size. The tile size has automatically been changed "
f"from {original_tile_size} to {tile_size}, but in "
f"future this will raise an error and the correct tile "
f"size should be specified directly.", AstropyDeprecationWarning)
warnings.warn(f"The tile size should be such that no tiles have "
f"fewer than 4 pixels. The tile size has "
f"automatically been changed from {original_tile_size} "
f"to {tile_size}, but in future this will raise an "
f"error and the correct tile size should be specified "
f"directly.", AstropyDeprecationWarning)

# Set up locations for writing the next cards in the header.
last_znaxis = "ZNAXIS"
Expand Down
3 changes: 3 additions & 0 deletions docs/changes/io.fits/14410.api.rst
@@ -0,0 +1,3 @@
Deprecate the auto-fixing of tile sizes for HCOMPRESS_1 tiled
image compression when the tile size could be changed by +1
to make it acceptable.

0 comments on commit 4556b49

Please sign in to comment.