You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a record array with an unsigned dtype is assigned to the data attribute of a BinTableHDU the data in the original array is modified when the BinTableHDU is saved (as seen in the example below).
This occurs in astropy 5.3 and a recently downloaded 6.0 nightly.
There are many places in stdatamodels where hdu.data is assigned. Given that the modification occurs when the file is saved (which may occur at some later point in the code) this seems likely to introduce insidious bugs.
Updating the assignments to hdu.data to either copy the assigned array and/or to define the array at the time of creation of the BinTableHDU (passing the array in via the data keyword of BinTableHDU.__init__ does not appear to have the same issue) should be considered.
The text was updated successfully, but these errors were encountered:
WARNING: Unexpected extra padding at the end of the file. This padding may not be preserved when saving changes. [astropy.io.fits.header]
[(32768, '\x00\x00\x10')]
Removing the 'a' column results in a correct output for 'i' (1) and removing 'i' results in the correct output for 'a' ('HOT'). However including both results in both items being corrupted.
If a record array with an unsigned dtype is assigned to the
data
attribute of aBinTableHDU
the data in the original array is modified when theBinTableHDU
is saved (as seen in the example below).Fails with:
AssertionError: 32769
This occurs in astropy 5.3 and a recently downloaded 6.0 nightly.
There are many places in stdatamodels where
hdu.data
is assigned. Given that the modification occurs when the file is saved (which may occur at some later point in the code) this seems likely to introduce insidious bugs.Updating the assignments to
hdu.data
to either copy the assigned array and/or to define the array at the time of creation of theBinTableHDU
(passing the array in via thedata
keyword ofBinTableHDU.__init__
does not appear to have the same issue) should be considered.The text was updated successfully, but these errors were encountered: