Skip to content

Commit f9c43c1

Browse files
committed
Old astropy rice read error has been fixed.
1 parent 35fc0d3 commit f9c43c1

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Script posted to demonstrate astropy error:
2+
# https://github.com/astropy/astropy/issues/15477
3+
# Fails on astropy 5.3 .. 7.2
4+
5+
from astropy.io import fits
6+
7+
file_name = 'testF.fits.fz'
8+
9+
with fits.open(file_name, 'readonly') as hdu_list:
10+
hdu = hdu_list[1]
11+
hdu.data

tests/test_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,9 @@ def test_Image_FITS_IO(run_slow):
629629
# Test rice
630630
# Avoid astropy 5.3 issue reading rice-compressed file.
631631
# cf. https://github.com/astropy/astropy/issues/15477
632-
# Hopefull they will fix it before 5.4 comes out...
632+
# Fixed in version 7.3.
633633
import astropy
634-
if astropy.__version__ >= "5.3" and astropy.__version__ < "5.4": continue
634+
if astropy.__version__ >= "5.3" and astropy.__version__ < "7.3": continue
635635
test_file = os.path.join(datadir, "test"+tchar[i]+".fits.fz")
636636
test_image = galsim.fits.read(test_file, compression='rice')
637637
np.testing.assert_array_equal(ref_array.astype(types[i]), test_image.array,

0 commit comments

Comments
 (0)