qcodes/tests/test_autoloadable_channels.py
def _get_new_instance_kwargs(
            cls, parent: Optional[Instrument] = None, **kwargs
    ) -> Dict[Any, Any]:
        """
        Find the smallest channel number not yet occupied. An optional keyword
        `greeting` is extracted from the kwargs. The default is "Hello"
        """
        if parent is None:
            raise RuntimeError("SimpleTestChannel needs a parent instrument")
        channels_str = parent.channel_catalog()
        existing_channels = [int(i) for i in channels_str.split(",")]

        new_channel = 1
        while new_channel in existing_channels:
            new_channel += 1

        new_kwargs = {
            "name": f"channel{new_channel}",
            "channel": new_channel,
            "greeting": kwargs.get("greeting", "Hello")
        }

        return new_kwargs

        Find the smallest channel number not yet occupied. An optional keyword
        `greeting` is extracted from the kwargs. The default is "Hello"
        
Find the smallest channel number not yet occupied. An optional keyword
`greeting` is extracted from the kwargs. The default is "Hello"
Find the smallest channel number not yet occupied . An optional keyword ` greeting ` is extracted from the kwargs . The default is " Hello "
def _get_new_instance_kwargs(
            cls, parent: Optional[Instrument] = None, **kwargs
    ) -> Dict[Any, Any]:
        if parent is None:
            raise RuntimeError("SimpleTestChannel needs a parent instrument")
        channels_str = parent.channel_catalog()
        existing_channels = [int(i) for i in channels_str.split(",")]
        new_channel = 1
        while new_channel in existing_channels:
            new_channel += 1
        new_kwargs = {
            "name": f"channel{new_channel}",
            "channel": new_channel,
            "greeting": kwargs.get("greeting", "Hello")
        }
        return new_kwargs
def _get_new_instance_kwargs ( cls , parent : Optional [ Instrument ] = None , ** kwargs ) -> Dict [ Any , Any ] : if parent is None : raise RuntimeError ( "SimpleTestChannel needs a parent instrument" ) channels_str = parent . channel_catalog ( ) existing_channels = [ int ( i ) for i in channels_str . split ( "," ) ] new_channel = 1 while new_channel in existing_channels : new_channel += 1 new_kwargs = { "name" : f"channel{new_channel}" , "channel" : new_channel , "greeting" : kwargs . get ( "greeting" , "Hello" ) } return new_kwargs
Find the smallest channel number not yet occupied.
Find the smallest channel number not yet occupied .
"""
        Find the smallest channel number not yet occupied. An optional keyword
        `greeting` is extracted from the kwargs. The default is "Hello"
        """
cls
parent
Optional[Instrument]