-
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
Feature/dem 564/driver for zi hdawg8 #1331
Feature/dem 564/driver for zi hdawg8 #1331
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1331 +/- ##
=======================================
Coverage 74.13% 74.13%
=======================================
Files 85 85
Lines 9822 9822
=======================================
Hits 7282 7282
Misses 2540 2540 |
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.
@qSaevar, this generally looks good. Since I don't have this unit myself, I can only give pretty limited feedback and mainly on style.
Before we merge this PR, the code needs to be in compliance with our "house style guide". Therefore, I'd like to ask you to
- Adhere to PEP8, in particular regarding line lengths (comments are no exception)
- Use type annotations throughout the driver.
- Remove the type annotations from the (otherwise splendid) docstrings. There is no need to write the type twice. This also includes the return value.
And then I have a question/concern. Although the create_parameters_from_node_tree
function is kind of nifty, I would be hesitant to use it on the ZI Instrument that I do have, namely the UHF-LI. The reason being that many parameters are interlinked (e.g. sweep frequencies center/span and min/max) and therefore must be updated together lest the snapshot of the instrument become inconsistent. Is this a problem for the hdawg as well?
I have addressed the code style comment and adjusted the code to the “house style guide”. Regarding the question/concern regarding creating parameters from the device tree: We do not share this concern as every parameter that can be set via this method can also be set in the LabOne web GUI. One has to have a basic understanding of the instrument before setting some variables, but at the end of the day generating parameters from the device node tree should not set the snapshot of the instrument in an inconsistent state. |
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.
Looks good (see only one comment of mine). +1 for the tests!
def download_device_node_tree(self, flags: int = 0) -> dict: | ||
""" | ||
Args: | ||
flags: 0x08, Returns only nodes which are marked as setting |
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.
would be nice if there was a dict that maps human-readable names to these flags, and let this method accept a list of those human-readable names. this will make the experimental code much more readable.
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.
Jebb, I removed it from the docstring to fit it to pep8 line length, but this is how the docstring was:
flags: ziPython.ziListEnum.settingsonly -> 0x08: Returns only nodes which are marked as setting
ziPython.ziListEnum.streamingonly -> 0x10: Returns only streaming nodes
ziPython.ziListEnum.subscribedonly -> 0x20: Returns only subscribed nodes
ziPython.ziListEnum.basechannel -> 0x40: Return only one instance of a node in case of multiple
channels
Or any combination of flags can be used.
But I can add it again
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.
ah, are you saying that zhinst
(or similar) has these flags defined? in case that module is necessary for working with the instrument, then it'd be really helpful to have these ziPython.ziListEnum.*
constants mentioned in the docstring. and in order to make it pep8 compatible, just reformat it a bit so that lines are shorted than 80 characters :)
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.
Yes, they are predefined constants provided by ZI. I reintroduced them to the docstring.
@qSaevar, thank you, the code is nice and tidy now. I am happy to merge now, but I'd like to understand the parameter business. I simply cannot see how this:
is relevant. Perhaps you can elaborate? I will also try to reformulate. An example (thought) situation: The instrument has parameters |
@WilliamHPNielsen, if you mean by |
@qSaevar we seem to misunderstand each other. My concern is not with those particular parameters (but thanks for the explanation), but is a more general one. I will try to explain: The question is simply: are you sure that none of the parameters added via Some background: For the UHF-LI a lot of parameters are interlinked. Changing one via the LabOne Interface immediately updates all its interlinked parameters in the LabOne interface, but extra care has to be taken to also update them in QCoDeS (basically, the |
@WilliamHPNielsen I see what you are saying. Short answer, no I'm not sure that no parameters are interlinked, it could very well be. The method |
Okay, that's what I suspected. But you do not seem shocked, so I think we can take an approach of "it's not a problem until it becomes a problem". But maybe the snapshot of this instrument should always update? |
@WilliamHPNielsen Should I then overwrite snapshot_base to force the instrument to always update? |
@WilliamHPNielsen @astafan8 This has been tested on hardware. Is there anything that needs to be done so the driver can me merged? |
@qSaevar I think overwriting the snapshot_base is the sensible approach. Do that, and we'll merge. |
* [DEM-564] Create a new HDAWG8 driver from ZI example
* [DEM-525] Improve raw waveform upload speed
@WilliamHPNielsen |
Merge: eb6d96f 3b9b342 Author: William H.P. Nielsen <[email protected]> Merge pull request #1331 from qutech-sd/feature/DEM-564/Driver-for-ZI-HDAWG8
Changes proposed in this pull request:
@WilliamHPNielsen