Add support for array parameters to MultiChannelInstrumentParameter#2
Conversation
And error clearly if you try to measure multiple multiparameters
This reverts commit 2dbacc0.
Add a QDac driver using the new channelisation feature
…array Feat/channelization with array
Make the paramclass returned by __getattr__ be customisable.
Add a channelised driver for the QDac. This requires changing the base code for channels a bit to allow for custom MultiChannelInstrumentParameter subclasses.
…array Driver/QDac_channels
spauka
left a comment
There was a problem hiding this comment.
Hey,
Changes look good and hopefully it was reasonably intuitive to convert the QDac into a channelized instrument. A few minor points raised in the review, although I'm not too fussed about any of them.
One suggestion for improving the readability of code given the 1-indexing of channels, if functions such as _set_voltage are part of the QDacChannel then it is possible to use the channum set for each class rather than having to do chan-1 repeatedly.
Something like:
class QDacChannel(InstrumentChannel):
...
def __init__(self, parent, name, channum):
...
self._channum = channum
def _set_voltage(self, v_set):
...
atten = self.vrange.get_latest()
...
self.write('set {} {:.6f}'.format(self._channum, v_set)Perhaps you want to add single channel indexing examples to the notebook, to demonstrate the equivalence between qdac.channels[0] and qdac.ch01.
| label=label, | ||
| unit='C', | ||
| get_cmd='tem {} {}'.format(board, sensor), | ||
| get_parser=self._num_verbose) |
There was a problem hiding this comment.
Should these be channelized as well?
Are there more parameters that are board specific, similar to slots in the Harvard DAC?
There was a problem hiding this comment.
They could be channelised, but noone uses them, so I think it's okay to leave them for now.
| self.visa_handle.read())) | ||
|
|
||
| # take care of the rest of the output | ||
| for ii in range(50): |
There was a problem hiding this comment.
Or maybe not... It's not so clear why this output is exactly 50 lines long (firmware design choice), but it will not change with self.num_chans. But I agree that magic numbers should be avoided.
| self.write('status') | ||
| FW_str = self._write_response | ||
| FW_version = float(FW_str.replace('Software Version: ', '')) | ||
| for ii in range(50): |
There was a problem hiding this comment.
No magic numbers. Let's make a variable for this.
|
|
||
| ######################### | ||
| # Channel gets/sets | ||
| ######################### |
There was a problem hiding this comment.
Should channel get/set be part of the QDacChannel class?
There was a problem hiding this comment.
I think it makes sense for this particular instrument to keep it in the main instrument, as the channels are interlinked via the _get_status command.
qcodes/instrument/channel.py
Outdated
| stored inside a channel list are accessible in multiple | ||
| ways and should not be repeated in an instrument snapshot. | ||
|
|
||
| paramclass (unknown): The class of the object to be returned by |
There was a problem hiding this comment.
unknown can be MultiChannelInstrumentParameter
qcodes/instrument/channel.py
Outdated
| def __init__(self, parent, name, chan_type, chan_list=None, snapshotable=True): | ||
| def __init__(self, parent, name, chan_type, chan_list=None, | ||
| snapshotable=True, | ||
| paramclass=MultiChannelInstrumentParameter): |
There was a problem hiding this comment.
paramclass is a slightly confusing variable name here. Perhaps something like multichan_paramclass. Given that this might be a slightly confusing concept for users I would be in favor of a more verbose variable name.
There was a problem hiding this comment.
I fully agree with you on this one.
|
@spauka Thanks, cant wait to get the channel support merged. I have another branch at https://github.com/jenshnielsen/qcodes/tree/feat/channelization_refactor_classes which implements 1 based indexing into the channels along with some refactoring. We choose to split these things up as what is in this pr is hopefully fairly non controversial, but the changes in the other PR will require some more thought and should perhaps be changed and/or removed. On top of that I did a version of microsoft#623 on top of the channels in https://github.com/jenshnielsen/qcodes/tree/znb_with_channels This looks very promising for the channels as it greatly simplifies the driver implementation (no more get_attr) and makes the the driver much easier to use (I expect, it's currently untested as I don't have access to a spare RS ZNB 20) |
|
@spauka I pushed some changes to address the issues per Williams suggestions |
|
Cool, I will pull this in. |
…ainer Call get_DB_debug and make sure its cast to bool
* [DEM-525] Improve raw waveform upload speed
Update QDevil branch from master
Changes proposed in this pull request: