qcodes.instrument_drivers.rohde_schwarz.private package
Submodules
qcodes.instrument_drivers.rohde_schwarz.private.HMC804x module
- class qcodes.instrument_drivers.rohde_schwarz.private.HMC804x.RohdeSchwarzHMC804xChannel(parent: Instrument, name: str, channel: Union[str, int])[source]
Bases:
InstrumentChannel
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: qcodes.instrument.instrument_base.InstrumentBase
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.