def _generate_tables(names_units: Iterable[Tuple]) -> List[ParamTable]: """ Generates ParamTables from a simple input list of tuples which describe the parameters. Args: names_units List of tuples with parameter names and units; optionally, 'paramtype' can be supplied that defines the way the parameter values are saved ('numeric' is a default). Example: [("gate", "V"), ("Isd", "A", "array")] Returns: A list of ParamTable with each table containing a single QcodesParamSpec """ param_tables = [] for name_unit in names_units: name = name_unit[0] unit = name_unit[1] if len(name_unit) > 2: paramtype = name_unit[2] else: paramtype = 'numeric' param_tables.append( ParamTable([ ParamSpec(name=name, paramtype=paramtype, unit=unit, label=name) ])) return param_tables
def __init__(self, set_function: Callable, parameter_table: ParamTable, point_function: Callable) -> None: super().__init__() self._point_function = point_function self._set_function = set_function self._parameter_table = parameter_table.copy()
def mk_tuple(name): param = Parameter(name, set_cmd=None, get_cmd=None) def getter(): return {name: param.get()} return param, getter, ParamTable([ParamSpec(name, "numeric")])
def mk_tuple(name): param = Parameter(name, set_cmd=None, get_cmd=None) def setter(value): param.set(value) return {name: value} return param, setter, ParamTable([ParamSpec(name, "numeric")])
def _generate_tables(names_units: Iterable[Tuple]) -> List[ParamTable]: """ Args: names_units: List of tuples with parameter names and units, e.g. [("gate", "V"), ("Isd", "A")] Returns: A list of ParamTable with each table containing a single spec """ return [ ParamTable( [ParamSpec(name=name, paramtype='numeric', unit=unit, label=name)]) for name, unit in names_units ]
def __init__(self, call_function, *args, **kwargs): super().__init__() self._caller = lambda: call_function(*args, **kwargs) self._parameter_table = ParamTable([], nests=[[]])