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
In 1.12 writing to ndarray.data was deprecated. I'll readily admit that this makes sense, but thought I would point out that it is used "in the wild" to work around windows issues. Specifically, see astropy/astropy#5797, where our tests now fail on a place which has the following interesting note:
ifsys.platform.startswith('win'):
# On Windows, all the original data mmaps were closed above.# However, it's possible that the user still has references to# the old data which would no longer work (possibly even cause# a segfault if they try to access it). This replaces the# buffers used by the original arrays with the buffers of mmap# arrays created from the new file. This seems to work, but# it's a flaming hack and carries no guarantees that it won't# lead to odd behavior in practice. Better to just not keep# references to data from files that had to be resized upon# flushing (on Windows--again, this is no problem on Linux).foridx, mmap, arrinmmaps:
ifmmapisnotNone:
>arr.data=self[idx].data.dataEDeprecationWarning: Assigningthe'data'attributeisaninherentlyunsafeoperationandwillberemovedinthefuture.
astropy\io\fits\hdu\hdulist.py:1342: DeprecationWarning
p.s. This code predates most of us currently working on astropy, and we're still trying to figure out what even the problem is and if there are other ways around it (suggestions most welcome).
Activity
mhvk commentedon Jan 11, 2024
This issue doesn't really seem actionable, so closing it.