Open EliotGann opened 5 years ago
PR #23 will resolve this issue
In fact this is already possible without changes to suitcase. Try:
tiff_series.export(db[-3].documents(fill=True), file_prefix='{start[user]}/{start[institution]}-Eph={event[data][energy]}-{s
...: tart[scan_id]}-', directory='Z:/images/users')
That is, file_prefix
is in general a relative filepath; it doesn’t have to be just a file name. We should add an example illustrating this in the docstring and the general suitcase documentation to make that clear.
Thedirectory
must always be a plain, un-templated path. But this does not limit what you can do. In the extreme case you can set directory=’/‘
and put all the rest of the path in file_prefix
if you need total flexibility. But usually there is some part of the path that means “location on system where the files go” and some part that means “subdirectories for specific group or experiment”.
If reading this via email, note that my previous comment was significantly edited due to accidentally submitting it mid-sentence.
OK so after some more investigation I am 100% convinced that @danielballan is correct. we should update the docs to indicate (and include an example) that file_prefix
can include path information as well as just a prefix for the file_name. This resolves the issue.
@danielballan, the suggested usage is pretty clear, I like it. Let's refer to it the same way we do with root
and write_path_template
of AD plugins: the former should be static/unchangeable, and the latter can be templated.
I'm fine with keeping this issue and #23 open until after @awalter-bnl is back.
It would be good to format the exporter's directory the same way we format the
file_prefix
.Current behavior: