{{ prefix }}
"""Autogenerated module for the {{ name }} QCoDeS driver."""
import re
from typing import Union, Optional,List,Dict, Any, Tuple
import deprecation
import numpy as np
from qcodes.instrument.channel import ChannelList
from qcodes.instrument.parameter import Parameter as QCParameter
from qcodes.utils.validators import ComplexNumbers
from zhinst.toolkit.driver.devices.{{ name.lower() }} import {{ name }} as TK{{ name }}
from zhinst.toolkit import CommandTable,Waveforms, Sequence
from zhinst.toolkit.interface import AveragingMode, SHFQAChannelMode
from zhinst.utils.shfqa.multistate import QuditSettings
from zhinst.qcodes.driver.devices.base import ZIBaseInstrument
from zhinst.qcodes.qcodes_adaptions import ZINode, ZIChannelList

{% for class in classes %}
{% if class.is_instrument_class %}
class {{ class.name }}(ZIBaseInstrument):
    """QCoDeS driver for the Zurich Instruments {{ class.name }}.
    """

    def _init_additional_nodes(self):
        """Init class specific modules and parameters."""
        {% filter indent(width=8) -%}{% include 'init_module.py.j2' %}{% endfilter %}
    {% filter indent(width=4) -%}{% include 'toolkit_function.py.j2' %}{% endfilter %}
{% else %}
class {{ class.name }}(ZINode):
    """{{ class.docstring }}"""
    def __init__(self, parent, tk_object{% if class.is_list %} , index{% endif %}, snapshot_cache=None, zi_node=None):
        ZINode.__init__(self, parent, {% if class.is_list %}f{% endif %}"{{ class.display_name }}{% if class.is_list %}_{index}{% endif %}", snapshot_cache=snapshot_cache, zi_node=zi_node)
        self._tk_object =  tk_object
        {% filter indent(width=8) -%}{% include 'init_module.py.j2' %}{% endfilter %}

    {% filter indent(width=4) -%}{% include 'toolkit_function.py.j2' %}{% endfilter %}
{% endif %}

{% for parameter in class.parameters %}
    @property
    def {{ parameter.name }} (self) -> {{parameter.return_annotation}}:
        """{{parameter.docstring}}"""
        return self._tk_object.{{ parameter.name }}
{% endfor %}
{% endfor %}

