-
Notifications
You must be signed in to change notification settings - Fork 26
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
Update hdfwriter to include full filepath in root key in resource doc, add uuid DirectoryProvider for dynamic filenames #154
Conversation
…es, remove hard coded device name/period in panda writer, fix formatting
2f89413
to
c8bca78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tested this addition at our lab with real PandA. All worked great!
self.hdf.file_name.set( | ||
f"{info.prefix}.{self.panda_device.name}{info.suffix}.h5" | ||
), | ||
self.hdf.file_name.set(f"{info.prefix}{info.suffix}.h5"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A note to reviewers: this change was to exclude the mandatory PandA device name from the file name. If needed, this can be added via info.prefix
at the device instantiation step.
The tests/linter issues need to be resolved, of course. |
This is handled slightly differently with the exisitng HDFFileWriter (passing the DirectoryInfo in whole), maybe allowing us to refactor the writer to use Path signals if #122 gets merged. It'd be good to settle on a common handling (not opposed to changing what's already in) or merging the implementations of HDFWriter, _HDFFile I've added a comment to the PR this PR is merging into to the effect of uniting the handling. |
@mrakitin why did you need to remove the PandA name from the HDF file path? We use the same DirectoryProvider in multiple detectors, so they need some level of uniqueness, hence the device name in the path. An alternative would be to change the signature of |
I was going to include a At NSLS-II we typically just use a UUID for the filename, which is inherently unique, so having a device name in the filepath is not necessary (see the |
Could pass an enum to the |
@callumforrester @DiamondJoseph could we rename to |
I'm not precious about naming. There might be cause at this point to split |
e19d34a
to
0dba74f
Compare
This PR does the following:
root
key was hard coded to/
DirectoryProvider
is a better solution.UUIDDirectoryProvider
that generates dynamic filenames based onuuid4
- this is how we typically run things at NSLS-II.