-
Notifications
You must be signed in to change notification settings - Fork 18
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
Dev small checks in merging #171
Conversation
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.
This is for when a user has set up a manual double ended mode right? Instead of relying on the machine creating, e.g., a single xml file which contains both the forward and backward measurements.
It would also be good to update the changelog!
Skips measurements for which there is no partner measurement. Little | ||
protection against swapping fw and bw is implemented. | ||
|
||
If all measurements are recorded: fw_t0, bw_t0, fw_t1, bw_t1, fw_t2, bw_t2, .. |
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.
Could you add a test for this?
You can then also add an xfail for the uncaught situation :)
Pytest's parameterize might come in useful for this to keep the test short.
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.
Great idea! Just implemented it.
and added verbose kwarg to merge_double_ended
([1, 2], [], [1, 2]), | ||
([], [1, 2], [1, 2]), | ||
([1], [2], [1, 2]), | ||
pytest.param([2], [1], [1, 2], marks=pytest.mark.xfail) |
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.
Nice :D
Hi! You didn't update the changelog ;) |
The number of measurements of the forward and backward channels might get out of sync if the device shuts down before the measurement of the last channel is complete. A function is added skips all measurements that are not accompanied with a partner channel.
If all measurements are recorded: fw_t0, bw_t0, fw_t1, bw_t1, fw_t2, bw_t2, .. > all are passed
If some are missing the accompanying measurement is skipped:
Not perfect and the following situation is not caught:
Mixing forward and backward channels can be problematic when there is a pause after measuring all channels. This routine checks that the lowest channel number is measured first (aka the forward channel), but it doesn't catch the last case as it doens't know that fw_t1 and bw_t2 belong to different cycles.