Closed psavery closed 1 month ago
@donald-e-boyce, can you review this one?
Attention: Patch coverage is 94.44444%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 33.53%. Comparing base (
433a0d5
) to head (e9017ee
).
Files | Patch % | Lines |
---|---|---|
hexrd/imageseries/load/framecache.py | 94.44% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Everything looks good, and my test problems work fine.
CI already passed except for the Mac test which was fixed in #713
Previously, just instantiating the imageseries would cause the data to be loaded. For some of the larger datasets from eiger, this could use a lot of RAM and time.
However, in some cases, we want to instantiate an imageseries just as a convenient (and somewhat standardized) way to look at things such as metadata (such as omegas) and other information without actually needing to load the data. This is actually something we do in the GUI to check the omegas (we do it for all image series types, in fact, not just frame-cache).
This commit changes the class to wait to load the data until it is actually requested. This makes loading it in the Simple Image Series loader in the GUI (which is done to check metadata) significantly faster.
This class still loads in all the frames the first time any frame is requested. Another potentially useful change would be to just load in whatever frame was requested and cache that frame in a dict (to be returned next time). However, maybe that could be done in the future if we encounter a more relevant use case for it.