allow control of memmapping for asdf files #232
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows control of memory mapping when opening an asdf file using
DataModel(asdf_filename)
. Control of memory mapping already exists for FITS files (through thememmap
argument which is reused here).asdf is making a few changes to memory mapping. This PR will help to prepare stdatamodels for those changes. Specifically, asdf will no longer force closure of memory mapped view of arrays (which can and often results in a segfault when an array access fails during an attempt to access the closed file). Instead, asdf will release all references to the opened memory map and rely on the garbage collector to close the file (see this asdf PR for more details: asdf-format/asdf#1668). This works in most situations but is complicated in a few stdatamodels tests which test for the number of open files without first destroying the model. This PR (by using the default
memmap=False
) allows the effected tests to pass as they no longer use memory mapping.Regression tests: https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1025/
show only existing 8 unrelated failures (due to niriss crds file updates).
Checklist
CHANGES.rst
(either inBug Fixes
orChanges to API
)