-
Notifications
You must be signed in to change notification settings - Fork 6
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
Recorded mock #13
base: develop
Are you sure you want to change the base?
Recorded mock #13
Conversation
This is also useful for automated testing with a recorded mockstream
It is possible that a recording of this stream has no clock offset saved which leads to the following issue: sccn/xdf#23 |
if time_diff > 0: | ||
time.sleep(time_diff) | ||
else: | ||
time.sleep(0.001) | ||
|
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.
The sleep in line 188/190 exhibits a bias, as you do not account for time spent in lines 182 to 186. One option is to measure this time spent, and reduce the time slept by this time, see re.g. Clock.sleep_debiased from Pyreiz:
https://github.com/pyreiz/pyreiz/blob/master/reiz/time.py#L83-L93
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.
Also, sleep has an inherent positive bias, that adds up over repeated calls. Consider a self-correcting scheduler implementation, e.g. https://gist.github.com/agricolab/1f35cecea25c3e251d40057f2221f831#file-periodic_self_correcting-py
This adds the option to use a pre-recorded xdf file to mock EEG data. It does not support marker streams.
It was tested with EEGO, BrainvisionRDA, and Spongebob data