Skip to content
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

Pass some context to user-supplied interrupt callback #82

Open
randomir opened this issue Sep 4, 2020 · 0 comments
Open

Pass some context to user-supplied interrupt callback #82

randomir opened this issue Sep 4, 2020 · 0 comments

Comments

@randomir
Copy link
Member

randomir commented Sep 4, 2020

Currently, the interrupt callback function is called after each sample (read), but it receives no context, like last sample or energy. Furthermore, it's not even possible to capture references to sample/energy arrays in closure because they are created in cython code and returned to python on the very end of sampling (i.e. after interrupted).

So, providing references to sample/energy numpy arrays (semi-filled) on each call of interrupt callback would enable user to stop sampling when energy threshold is reached, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant