Base implementation of user path extension [RFC] #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current State
We are performing a lot of measurements, and it is often convenient to store them grouped by sample in a folder.
There is a hack to do so by changing the user's name:
This works, but is cumbersome.
Implementation Possibilities
Per Measurement
When a measurement is started, the information could be pulled from the sample object. This, however is highly measurement specific and is not available at the point where the file name is generated (in
hdf_DateTimeGenerator.py
).Global Configuration (With provided implementation)
Less nice, but simpler to implement and test. A new configuration option would be available, called
path_extension
(preliminary). If set to a non-empty string, then the path is extended inhdf_DateTimeGenerator.py
.Usage would look like this:
This allows the user to set the sample at the beginning of the notebook. This has two disadvantages:
The provided implementation includes
pytest
tests to verify that the implementation is equivalent to the old behaviour ifpath_extension
is not set.Possible Extension: Natively Supported Hirarchy
If an array of strings were allowed, then
colud become possible, removing problems with
\
and escape sequences.Possible Extension: Self-Resetting Configuration as a Safety Measure
qkit.cfg['path_extension']
could be reset after each measurement to enforce the user sets it before each measurement. This would relax the second disadvantage mentioned above.Request for Comment
This is a change in the core module of qkit, which is why I'd like to ask for comments. I see the following questions:
path_extension
clear enough?