Skip to content
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

Frame cache writer #605

Merged
merged 2 commits into from
Jan 16, 2024
Merged

Conversation

donald-e-boyce
Copy link
Collaborator

This allows you to write an imageseries in frame-cache format without specfying the cache_file keyword argument.

Before this change, you would pass the filename argument as well as the the cache_file keyword arg, usually the same value in both places. Now, the cache_file is determined from the filename.

The history of this is that the original format for frame-cache was a YAML file for the metadata, and the imagefiles were stored as sparse arrays in a numpy npz file, the cache file. Currently the default format is to save all image data and metadata both in the same file, so a separate cache file is not necessary.

For the YAML format, the cache file (if not an absolute path) is taken relative to the YAML file, so any directory is prepended to the cache file. For the single npz file format, this has the annoying affect that if you specify a directory in the YAML file and also in the cache file, the directory gets prepended again to the cache file, invalidating the path.

I also added a DeprecationWarning for writing to the YAML format, since the single file format is concise, efficient and general enough for the metadata likely to be needed with the imageseries.

Copy link
Collaborator

@psavery psavery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This will also simplify HEXRDGUI code located here and here.

@donald-e-boyce donald-e-boyce merged commit 243a4a2 into HEXRD:master Jan 16, 2024
6 checks passed
@donald-e-boyce donald-e-boyce deleted the frame-cache-writer branch January 24, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants