labcore.measurement.sweep#
Functions
|
Append two sweeps. |
|
Convenient in-line creation of a pointer function. |
|
Nest two sweeps. |
|
Return a sweep that executes the action once. |
|
Create a decorator for functions that return pointer generators. |
|
Create a sweep over a parameter. |
|
Zip two sweeps. |
Classes
|
|
|
Base class decorator used to record asynchronous data from instrument. |
|
|
|
|
|
A class that allows using a generator function as a pointer. |
|
Base class for sweeps. |
|
Iterator for the |
|
- class labcore.measurement.sweep.AppendSweeps(first: Sweep, second: Sweep)[source]#
Bases:
CombineSweeps
- class labcore.measurement.sweep.AsyncRecord(*specs)[source]#
Bases:
objectBase class decorator used to record asynchronous data from instrument. Use the decorator with create_background_sweep function to create Sweeps that collect asynchronous data from external devices running experiments independently of the measurement PC, e.i. the measuring happening is not being controlled by a Sweep but instead an external device (e.g. the OPX). Each instrument should have its own custom setup_wrapper (see setup_wrapper docstring for more info), and a custom collector. Auxiliary functions for the start_wrapper and collector should also be located in this class.
- Parameters:
specs – A list of the DataSpecs to record the data produced.
- wrap_setup(fun: Callable, *args: Any, **kwargs: Any) Callable[source]#
Wraps the start function. setup_wrapper should consist of another function inside of it decorated with @wraps with fun as its argument. In this case the wrapped function is setup. Setup should accept the *args and **kwargs of fun. It should also place any returns from fun in the communicator. setup_wrapper needs to return the wrapped function (setup).
- Parameters:
fun – The measurement function. In the case of the OPX this would be the function that returns the QUA code with any arguments that it might use.
- class labcore.measurement.sweep.NestSweeps(first: Sweep, second: Sweep)[source]#
Bases:
CombineSweeps
- class labcore.measurement.sweep.PointerFunction(func, *data_specs)[source]#
Bases:
FunctionToRecordsA class that allows using a generator function as a pointer.
- using(*args, **kwargs) PointerFunction[source]#
Set the default positional and keyword arguments that will be used when the function is called.
- Returns:
A copy of the object. This is to allow setting different defaults to multiple uses of the function.
- class labcore.measurement.sweep.Sweep(pointer: Iterable | None, *actions: Callable)[source]#
Bases:
objectBase class for sweeps.
Can be iterated over; for each pointer value the associated actions are executed. Each iteration step produces a record, containing all values produced by pointer and actions that have been annotated as such. (see:
record_as())- Parameters:
pointer – An iterable that defines the steps over which we iterate
actions – A variable number of functions. Each will be called for each iteration step, with the pointer value(s) as arguments, provided the function can accept it.
- property action_kwargs#
- static link_sweep_properties(src: Sweep, target: Sweep) None[source]#
Share state properties between sweeps.
- property pass_kwargs#
- pass_on_none = False#
- pass_on_returns = True#
- record_none = True#
- run() SweepIterator[source]#
Create the iterator for the sweep.
- set_options(**action_kwargs: Dict[str, Any])[source]#
Configure the sweep actions.
- Parameters:
action_kwargs – Keyword arguments to pass to action functions format: {‘<action_name>’: {‘key’: ‘value’} <action_name> is what action_function.__name__ returns.
- property state#
- class labcore.measurement.sweep.SweepIterator(sweep: Sweep, state: Dict[str, Any], pass_kwargs=typing.Dict[str, typing.Any], action_kwargs=typing.Dict[str, typing.Dict[str, typing.Any]])[source]#
Bases:
objectIterator for the
Sweepclass.Manages the actual iteration of the pointer, and the execution of action functions. Manages and updates the state of the sweep.
- class labcore.measurement.sweep.ZipSweeps(first: Sweep, second: Sweep)[source]#
Bases:
CombineSweeps
- labcore.measurement.sweep.append_sweeps(first: Sweep, second: Sweep) Sweep[source]#
Append two sweeps.
Iteration over the combined sweep will first complete the first sweep, then the second sweep.
- labcore.measurement.sweep.as_pointer(fun: Callable, *data_specs: str | Tuple[str, None | List[str] | Tuple[str], str, str] | Dict[str, str | None | List[str] | Tuple[str]] | DataSpec) PointerFunction[source]#
Convenient in-line creation of a pointer function.
- labcore.measurement.sweep.nest_sweeps(outer: Sweep, inner: Sweep) Sweep[source]#
Nest two sweeps.
Iteration over the combined sweep will execute the full inner sweep for each iteration step of the outer sweep.
- labcore.measurement.sweep.once(action: Callable) Sweep[source]#
Return a sweep that executes the action once.
- labcore.measurement.sweep.pointer(*data_specs: str | Tuple[str, None | List[str] | Tuple[str], str, str] | Dict[str, str | None | List[str] | Tuple[str]] | DataSpec) Callable[source]#
Create a decorator for functions that return pointer generators.
- labcore.measurement.sweep.sweep_parameter(param: str | Parameter | Tuple[str, None | List[str] | Tuple[str], str, str] | DataSpec, sweep_iterable: Iterable, *actions: Callable) Sweep[source]#
Create a sweep over a parameter.
- Parameters:
param –
One of:
A string: Generates an independent, scalar data parameter.
A tuple or list: will be passed to the constructor of
DataSpec; seemake_data_spec().A
DataSpecinstance.A qcodes parameter. In this case the parameter’s
setmethod is called for each value during the iteration.
sweep_iterable – An iterable that generates the values the parameter will be set to.
actions – An arbitrary number of action functions.