boss.interfaces - heros-boss 0.6.7 documentation

Skip to content
Back to top
View this page

# boss.interfaces

This module contains adapters/wrappers for classes from libraries that need special treatment for usage with HEROS

## Submodules

- boss.interfaces.qcodes

## Classes

`QCodesDeviceWrapper` | HEROS representation of a generic QCoDeS Instrument.

## Package Contents

class boss.interfaces.QCodesDeviceWrapper(**_kwargs)

  HEROS representation of a generic QCoDeS Instrument.

  This class wraps QCoDeS instruments to make them accessible through HEROS. It provides methods to resolve parameters (including those in submodules) and build dynamic subclasses that expose QCoDeS functionality.

  _qcodes_instance

    The wrapped QCoDeS instrument instance

  _qcodes_instance: type
  name: str
  static _resolve_parameter(qcodes_instance: Any, parameter_path: str) → tuple

    Resolve a parameter path to a QCoDeS parameter instance.

    This method takes a parameter path (e.g., “submodule.param_name”) and navigates through the QCoDeS instrument’s submodules to find the specified parameter.

    Parameters:

      - qcodes_instance – The QCoDeS instrument instance

      - parameter_path – Dot-separated path to the parameter (e.g., “submodule.param_name”)

    Returns:

      A tuple of (target_instance, parameter) where target_instance is the QCoDeS instance (device or submodule) containing the parameter, and parameter is the parameter itself

    Raises:

      AttributeError – If the submodule path is invalid or the parameter doesn’t exist

  classmethod _build(source_class: type, name: str, arg_dict: dict) → type

    Build a dynamic subclass that wraps a QCoDeS instrument.

    This method creates a new class that inherits from QCodesDeviceWrapper and wraps the specified QCoDeS instrument class. It exposes selected parameters as attributes and copies methods from the QCoDeS instrument to be exposed to HEROS.

    Parameters:

      - source_class – The QCoDeS instrument class to wrap

      - name – Name of the HERO used as an internal name for QCoDeS

      - arg_dict – Dictionary of arguments for the QCoDeS instrument constructor, including a ‘parameters’ key with a list of parameter paths to expose

  get_parameter_spec(parameter_path: str) → dict

    Get the parameter specification of a parameter.

    This method retrieves the specification dictionary for a QCoDeS parameter, which contains metadata about the parameter such as its type, units, etc.

    Parameters:

      parameter_path – Dot-separated path to the parameter (e.g., “submodule.param_name”)

    Returns:

      Dictionary containing the parameter specification

    Raises:

      AttributeError – If the parameter path is invalid