utility#

Utility functions for the instrument coordinator and components.

Module Contents#

Functions#

search_settable_param(→ qcodes.instrument.Parameter)

Searches for a settable parameter in nested instrument hierarchies.

parameter_value_same_as_cache(→ bool)

Returns whether the value of a QCoDeS parameter is the same as the value in cache.

lazy_set(→ None)

Set the value of a QCoDeS parameter only if it is different from the value in cache.

check_already_existing_acquisition(new_dataset, ...)

Verifies non-overlapping data in new_dataset and current_dataset.

Attributes#

logger[source]#
search_settable_param(instrument: qcodes.instrument.base.InstrumentBase, nested_parameter_name: str) qcodes.instrument.Parameter[source]#

Searches for a settable parameter in nested instrument hierarchies.

For example instrument.submodule_1.channel_1.parameter.

Parameters:
  • instrument – The root QCoDeS instrument where the parameter resides.

  • nested_parameter_name – Hierarchical nested parameter name.

Return type:

Parameter

parameter_value_same_as_cache(instrument: qcodes.instrument.base.InstrumentBase, parameter_name: str, val: Any) bool[source]#

Returns whether the value of a QCoDeS parameter is the same as the value in cache.

Parameters:
  • instrument – The QCoDeS instrument to set the parameter on.

  • parameter_name – Name of the parameter to set.

  • val – Value to set it to.

Return type:

bool

lazy_set(instrument: qcodes.instrument.base.InstrumentBase, parameter_name: str, val: Any) None[source]#

Set the value of a QCoDeS parameter only if it is different from the value in cache.

Parameters:
  • instrument – The QCoDeS instrument to set the parameter on.

  • parameter_name – Name of the parameter to set.

  • val – Value to set it to.

check_already_existing_acquisition(new_dataset: xarray.Dataset, current_dataset: xarray.Dataset)[source]#

Verifies non-overlapping data in new_dataset and current_dataset.

If there is, it will raise an error.

Parameters:
  • new_dataset – New dataset.

  • current_dataset – Current dataset.