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
DataModel will create a FileReference for the hdulist and keep it open. This appears to be unnecessary (adding a hdulist.close() on line doesn't break any jwst unit tests). This makes sense because the call to from_fits has to deal with the various quirks of FITS and results in loading all contents from the FITS file.
If we instead just close the hdulist a FileReference is no longer needed.
If we take this one step further and use lazy_load=False with asdf we could entirely remove FileReference and DataModel.close which would simplify the DataModel and ModelContainer api (by no longer needing to close or keep track of closing files).
The text was updated successfully, but these errors were encountered:
When opening a
DataModel
stored in aFITS
file:stdatamodels/src/stdatamodels/model_base.py
Lines 238 to 244 in 4041d5f
DataModel
will create aFileReference
for thehdulist
and keep it open. This appears to be unnecessary (adding ahdulist.close()
on line doesn't break any jwst unit tests). This makes sense because the call tofrom_fits
has to deal with the various quirks ofFITS
and results in loading all contents from theFITS
file.If we instead just close the hdulist a
FileReference
is no longer needed.If we take this one step further and use
lazy_load=False
withasdf
we could entirely removeFileReference
andDataModel.close
which would simplify theDataModel
andModelContainer
api (by no longer needing to close or keep track of closing files).The text was updated successfully, but these errors were encountered: