-
Notifications
You must be signed in to change notification settings - Fork 321
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
Alazar: refactor DLL API related things #1471
Alazar: refactor DLL API related things #1471
Conversation
…odes into cgranade/mercury-fieldvector
…to cgranade/alazar-async
…to cgranade/alazar-async
…odes into cgranade/mercury-fieldvector
…/Qcodes into alazar-api-dll
Codecov Report
@@ Coverage Diff @@
## master #1471 +/- ##
==========================================
- Coverage 73.84% 70.57% -3.27%
==========================================
Files 92 102 +10
Lines 10459 11546 +1087
==========================================
+ Hits 7723 8149 +426
- Misses 2736 3397 +661 |
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 looks good. Only a few very minor comments. Let me know if I should test it on a 9360 card
Now that we have tests for the Alazar it can be removed from the excluded here https://github.com/QCoDeS/Qcodes/blob/master/qcodes/.coveragerc
The trailing whitespaces that codacy found should also be fixed
@jenshnielsen If you have time, i'd appreciate if you test this PR on your setup. I am also going to test it with my 9360 card. In particular, it would be great if you have some tests at hand which can show that the overall performance did not degrade. |
... now that there are at least some tests
After CI is done, i'll squash-merge it (rebasing ~2000 commits was not successful at all). |
Author: Mikhail Astafev <[email protected]> Alazar: refactor DLL API related things (#1471)
Main point of the PR
This PR extracts all C-level calls to the Alazar SDK into its own class to make it easier for that class to manage the use of background threads (and other stuff, if needed, like asyncio), and remove all these low-level details out of the driver class to make the latter manageable.
This is done by:
AlazarAPIAPI
class that is based onWrappedDll
class andDllWrapperMeta
metaclass.WrappedDll
usesDllWrapperMeta
class:signatures
attribute)WrappedDll
allowsAlazarATSAPI
methods (that represent Alazar ATS API functions) to accept qcodesParameters
, and makes them aware ofTraceParameters
of the alazar driver.AlazarATSAPI
class definesctypes
signatures for relevant DLL functions, as well as bound methods which represent them; the class also implements convenience methods which make work with the API functions more convenient from the driver class point of view.Note that the new DLL wrapper class here is somewhat coupled to the Alazar usage, generalizing it to "any DLL" does not bring much value now.
Thanks to @cgranade for the initial bulk of the work in #1379 PR. However, asyncio-related parts were not taken into this PR.
Other changes in this PR:
To-Do:
Epilogue:
From Alazar API header files: