qcodes/dataset/descriptions/detect_shapes.py
def detect_shape_of_measurement(
        parameters: Sequence[_BaseParameter],
        steps: Union[Sequence[int], Sequence[Sized]] = ()
) -> Dict[str, Tuple[int, ...]]:
    """
    Construct the shape of a measurement of a dependent parameter from the
    parameter and the axes it is to be sweept over. Note that the
    steps should be given in the order from outer to inner loop and
    the shape will be returned in C order with the inner loop at the
    end.

    Args:
        parameters: The dependent parameters to construct the shape for
        steps: Zero or more dimensions that the parameter is to be sweept over.
           These can be given either as the length of the dimension or as
           a sequence of numbers to sweep over.

    Returns:
        A dictionary from the parameter name to a tuple of integers describing
        the shape.

    Raises:
        TypeError: If the shape cannot be detected due to incorrect types of
            parameters or steps supplied.
    """

    loop_shape: List[int] = []

    for step in steps:
        loop_shape.append(_get_shape_of_step(step))

    array_shapes: Dict[str, Tuple[int, ...]] = {}

    for param in parameters:

        if isinstance(param, MultiParameter):
            array_shapes.update(_get_shapes_of_multi_parameter(param=param))
        elif _param_is_array_like(param):
            array_shapes[param.full_name] = _get_shape_of_arrayparam(param)
        else:
            array_shapes[param.full_name] = ()

    shapes: Dict[str, Tuple[int, ...]] = {}

    for param_name in array_shapes.keys():
        total_shape = tuple(loop_shape) + array_shapes[param_name]
        if total_shape == ():
            total_shape = (1,)
        shapes[param_name] = total_shape

    return shapes

    Construct the shape of a measurement of a dependent parameter from the
    parameter and the axes it is to be sweept over. Note that the
    steps should be given in the order from outer to inner loop and
    the shape will be returned in C order with the inner loop at the
    end.

    Args:
        parameters: The dependent parameters to construct the shape for
        steps: Zero or more dimensions that the parameter is to be sweept over.
           These can be given either as the length of the dimension or as
           a sequence of numbers to sweep over.

    Returns:
        A dictionary from the parameter name to a tuple of integers describing
        the shape.

    Raises:
        TypeError: If the shape cannot be detected due to incorrect types of
            parameters or steps supplied.
    
Construct the shape of a measurement of a dependent parameter from the
parameter and the axes it is to be sweept over. Note that the
steps should be given in the order from outer to inner loop and
the shape will be returned in C order with the inner loop at the
end.
Construct the shape of a measurement of a dependent parameter from the parameter and the axes it is to be sweept over . Note that the steps should be given in the order from outer to inner loop and the shape will be returned in C order with the inner loop at the end .
def detect_shape_of_measurement(
        parameters: Sequence[_BaseParameter],
        steps: Union[Sequence[int], Sequence[Sized]] = ()
) -> Dict[str, Tuple[int, ...]]:
    loop_shape: List[int] = []
    for step in steps:
        loop_shape.append(_get_shape_of_step(step))
    array_shapes: Dict[str, Tuple[int, ...]] = {}
    for param in parameters:
        if isinstance(param, MultiParameter):
            array_shapes.update(_get_shapes_of_multi_parameter(param=param))
        elif _param_is_array_like(param):
            array_shapes[param.full_name] = _get_shape_of_arrayparam(param)
        else:
            array_shapes[param.full_name] = ()
    shapes: Dict[str, Tuple[int, ...]] = {}
    for param_name in array_shapes.keys():
        total_shape = tuple(loop_shape) + array_shapes[param_name]
        if total_shape == ():
            total_shape = (1,)
        shapes[param_name] = total_shape
    return shapes
def detect_shape_of_measurement ( parameters : Sequence [ _BaseParameter ] , steps : Union [ Sequence [ int ] , Sequence [ Sized ] ] = ( ) ) -> Dict [ str , Tuple [ int , ... ] ] : loop_shape : List [ int ] = [ ] for step in steps : loop_shape . append ( _get_shape_of_step ( step ) ) array_shapes : Dict [ str , Tuple [ int , ... ] ] = { } for param in parameters : if isinstance ( param , MultiParameter ) : array_shapes . update ( _get_shapes_of_multi_parameter ( param = param ) ) elif _param_is_array_like ( param ) : array_shapes [ param . full_name ] = _get_shape_of_arrayparam ( param ) else : array_shapes [ param . full_name ] = ( ) shapes : Dict [ str , Tuple [ int , ... ] ] = { } for param_name in array_shapes . keys ( ) : total_shape = tuple ( loop_shape ) + array_shapes [ param_name ] if total_shape == ( ) : total_shape = ( 1 , ) shapes [ param_name ] = total_shape return shapes
Construct the shape of a measurement of a dependent parameter from the
parameter and the axes it is to be sweept over.
Construct the shape of a measurement of a dependent parameter from the parameter and the axes it is to be sweept over .
"""
    Construct the shape of a measurement of a dependent parameter from the
    parameter and the axes it is to be sweept over. Note that the
    steps should be given in the order from outer to inner loop and
    the shape will be returned in C order with the inner loop at the
    end.

    Args:
        parameters: The dependent parameters to construct the shape for
        steps: Zero or more dimensions that the parameter is to be sweept over.
           These can be given either as the length of the dimension or as
           a sequence of numbers to sweep over.

    Returns:
        A dictionary from the parameter name to a tuple of integers describing
        the shape.

    Raises:
        TypeError: If the shape cannot be detected due to incorrect types of
            parameters or steps supplied.
    """
A dictionary from the parameter name to a tuple of integers describing
the shape.
A dictionary from the parameter name to a tuple of integers describing the shape .
If the shape cannot be detected due to incorrect types of
parameters or steps supplied.
If the shape cannot be detected due to incorrect types of parameters or steps supplied .
TypeError
parameters
Sequence[_BaseParameter]
The dependent parameters to construct the shape for
The dependent parameters to construct the shape for
steps
Union[Sequence[int], Sequence[Sized]]
Zero or more dimensions that the parameter is to be sweept over.
These can be given either as the length of the dimension or as
a sequence of numbers to sweep over.
Zero or more dimensions that the parameter is to be sweept over . These can be given either as the length of the dimension or as a sequence of numbers to sweep over .