-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate need for lazy_load
ing asdf files
#1341
Comments
Here's the PR where we introduced lazy_load = False: #774 (comment) Some back and forth between me and you there! It looks like the core issue is that we need to think harder about when we're responsible for closing files if we want to do lazy_load = False, which certainly sounds doable. |
Thanks! The point about when files are closed is a great addition to this issue. I started a test PR with the |
The above test PR shows no unit test failure but several regression test failures:
|
To provide one example of an issue in the code that disabling lazy loading is currently hiding is in the flat field step. The step modifies the input model in place but also explicitly closes the input file:
So when provided a filename as an input it will open the model in the file, perform the flat field, then close the file and return the model (which refers to a closed file). This leads to the errors above in the flat field regression tests. |
Now that files can be loaded with a "lazy_tree" (spacetelescope/roman_datamodels#358) some investigation of the "lazy_load" usage in romancal is worth undertaking:
https://github.com/search?q=repo%3Aspacetelescope%2Fromancal%20lazy_load&type=code
The use of "lazy_load=False" prevents much of the benefits of "lazy_tree" since with "lazy_load=False" all ASDF block data is loaded on the call to
asdf.open
.The text was updated successfully, but these errors were encountered: