boss.interfaces.qcodes
======================

.. py:module:: boss.interfaces.qcodes

.. autoapi-nested-parse::

   QCodes Library Interface for BOSS/HEROS.



Classes
-------

.. autoapisummary::

   boss.interfaces.qcodes.QCodesParam
   boss.interfaces.qcodes.QCodesDeviceWrapper


Module Contents
---------------

.. py:class:: QCodesParam(target_cls: Any, sub_mod_prefix: str)

   HEROS representation of a QCoDeS parameter.

   This class acts as a descriptor that provides access to QCoDeS parameters
   through a HEROS interface. It handles getting and setting parameter values
   and manages parameter naming with QCoDes submodule prefixes.

   `QCoDeS parameter <https://microsoft.github.io/Qcodes/api/parameters/index.html#qcodes.parameters.Parameter>`_

   .. attribute:: target_cls

      The QCoDeS instrument class containing the parameter

   .. attribute:: sub_mod_prefix

      Prefix for submodule parameters

   .. attribute:: name

      Name of the parameter


   .. py:attribute:: sub_mod_prefix


   .. py:attribute:: target_cls


   .. py:method:: __set_name__(owner: Any, name: str) -> None

      Set name of QCoDeS parameter to name of the attribute in the owner class.

      This method is called when the descriptor is assigned to a class attribute.

      :param owner: The class that owns this descriptor
      :param name: The name of the attribute in the owner class



   .. py:method:: __get__(obj: Any, *_args) -> Any

      Get underlying QCoDeS parameter value.

      :param obj: Instance of the owner class

      :returns: The current value of the QCoDeS parameter, or None if an error occurs



   .. py:method:: __set__(obj: Any, value: Any) -> None

      Set underlying QCoDeS parameter value.

      :param obj: Instance of the owner class
      :param value: Value to set for the QCoDeS parameter



.. py:class:: 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.

   .. attribute:: _qcodes_instance

      The wrapped QCoDeS instrument instance


   .. py:attribute:: _qcodes_instance
      :type:  type


   .. py:attribute:: name
      :type:  str


   .. py:method:: _resolve_parameter(qcodes_instance: Any, parameter_path: str) -> tuple
      :staticmethod:


      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.

      :param qcodes_instance: The QCoDeS instrument instance
      :param 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



   .. py:method:: _build(source_class: type, name: str, arg_dict: dict) -> type
      :classmethod:


      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.

      :param source_class: The QCoDeS instrument class to wrap
      :param name: Name of the HERO used as an internal name for QCoDeS
      :param arg_dict: Dictionary of arguments for the QCoDeS instrument constructor,
                       including a 'parameters' key with a list of parameter paths to expose



   .. py:method:: 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.

      :param 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



