An error showed up recently on a new system I am using when I want to create simple BinTableHDU with astropy.
Here is the code I setup to isolate the problem :
import astropy.io.fits as pyfits
ar = numpy.array(range(100))
col = pyfits.Column(name='TEST', array=ar, format='D')
cdef = pyfits.ColDefs([col])
hdu = pyfits.BinTableHDU.from_columns(cdef)
hdu.writeto("test.fits")
pyfits.getdata("test.fits")
I get this error :
AttributeError: 'record' object has no attribute '_coldefs'
I use astropy 2.0.2 with python 3.6.3.
Any idea to solve this problem ?
[EDIT:] when run in a script, an explicit access to the data is needed to trigger the error :
print(pyfits.getdata("test.fits"))