qcodes/dataset/data_export.py
def datatype_from_setpoints_2d(xpoints: np.ndarray,
                               ypoints: np.ndarray
                               ) -> str:
    """
    For a 2D plot, figure out what kind of visualisation we can use
    to display the data.

    Plot types are:
    * '2D_point' - all setpoint are the same in each direction; one point
    * '2D_grid' - colormap plot for data that is on a grid
    * '2D_equidistant' - colormap plot for data that is on equidistant grid
    * '2D_scatter' - scatter plot
    * '2D_unknown' - returned in case the data did not match any criteria of the
    other plot types

    Args:
        xpoints: The x-axis values
        ypoints: The y-axis values

    Returns:
        A string with the name of the determined plot type
    """
    # We represent categorical data as integer-valued data
    if isinstance(xpoints[0], str):
        xpoints = _strings_as_ints(xpoints)
    if isinstance(ypoints[0], str):
        ypoints = _strings_as_ints(ypoints)

    # First check whether all setpoints are identical along
    # any dimension
    x_all_the_same = np.allclose(xpoints, xpoints[0])
    y_all_the_same = np.allclose(ypoints, ypoints[0])

    if x_all_the_same or y_all_the_same:
        return '2D_point'

    # Now check if this is a simple rectangular sweep,
    # possibly interrupted in the middle of one row

    xrows = _rows_from_datapoints(xpoints)
    yrows = _rows_from_datapoints(ypoints)

    x_check = _all_in_group_or_subgroup(xrows)
    y_check = _all_in_group_or_subgroup(yrows)

    x_check = x_check and (len(xrows[0]) == len(yrows))
    y_check = y_check and (len(yrows[0]) == len(xrows))

    # this is the check that we are on a "simple" grid
    if y_check and x_check:
        return '2D_grid'

    x_check = _all_steps_multiples_of_min_step(xrows)
    y_check = _all_steps_multiples_of_min_step(yrows)

    # this is the check that we are on an equidistant grid
    if y_check and x_check:
        return '2D_equidistant'

    return '2D_unknown'

    For a 2D plot, figure out what kind of visualisation we can use
    to display the data.

    Plot types are:
    * '2D_point' - all setpoint are the same in each direction; one point
    * '2D_grid' - colormap plot for data that is on a grid
    * '2D_equidistant' - colormap plot for data that is on equidistant grid
    * '2D_scatter' - scatter plot
    * '2D_unknown' - returned in case the data did not match any criteria of the
    other plot types

    Args:
        xpoints: The x-axis values
        ypoints: The y-axis values

    Returns:
        A string with the name of the determined plot type
    
For a 2D plot, figure out what kind of visualisation we can use
to display the data.


For a 2D plot figure out what kind of visualisation we can use to display the data .
def datatype_from_setpoints_2d(xpoints: np.ndarray,
                               ypoints: np.ndarray
                               ) -> str:
    if isinstance(xpoints[0], str):
        xpoints = _strings_as_ints(xpoints)
    if isinstance(ypoints[0], str):
        ypoints = _strings_as_ints(ypoints)
    x_all_the_same = np.allclose(xpoints, xpoints[0])
    y_all_the_same = np.allclose(ypoints, ypoints[0])
    if x_all_the_same or y_all_the_same:
        return '2D_point'
    xrows = _rows_from_datapoints(xpoints)
    yrows = _rows_from_datapoints(ypoints)
    x_check = _all_in_group_or_subgroup(xrows)
    y_check = _all_in_group_or_subgroup(yrows)
    x_check = x_check and (len(xrows[0]) == len(yrows))
    y_check = y_check and (len(yrows[0]) == len(xrows))
    if y_check and x_check:
        return '2D_grid'
    x_check = _all_steps_multiples_of_min_step(xrows)
    y_check = _all_steps_multiples_of_min_step(yrows)
    if y_check and x_check:
        return '2D_equidistant'
    return '2D_unknown'
def datatype_from_setpoints_2d ( xpoints : np . ndarray , ypoints : np . ndarray ) -> str : if isinstance ( xpoints [ 0 ] , str ) : xpoints = _strings_as_ints ( xpoints ) if isinstance ( ypoints [ 0 ] , str ) : ypoints = _strings_as_ints ( ypoints ) x_all_the_same = np . allclose ( xpoints , xpoints [ 0 ] ) y_all_the_same = np . allclose ( ypoints , ypoints [ 0 ] ) if x_all_the_same or y_all_the_same : return '2D_point' xrows = _rows_from_datapoints ( xpoints ) yrows = _rows_from_datapoints ( ypoints ) x_check = _all_in_group_or_subgroup ( xrows ) y_check = _all_in_group_or_subgroup ( yrows ) x_check = x_check and ( len ( xrows [ 0 ] ) == len ( yrows ) ) y_check = y_check and ( len ( yrows [ 0 ] ) == len ( xrows ) ) if y_check and x_check : return '2D_grid' x_check = _all_steps_multiples_of_min_step ( xrows ) y_check = _all_steps_multiples_of_min_step ( yrows ) if y_check and x_check : return '2D_equidistant' return '2D_unknown'
For a 2D plot, figure out what kind of visualisation we can use
to display the data.
For a 2D plot figure out what kind of visualisation we can use to display the data .
"""
    For a 2D plot, figure out what kind of visualisation we can use
    to display the data.

    Plot types are:
    * '2D_point' - all setpoint are the same in each direction; one point
    * '2D_grid' - colormap plot for data that is on a grid
    * '2D_equidistant' - colormap plot for data that is on equidistant grid
    * '2D_scatter' - scatter plot
    * '2D_unknown' - returned in case the data did not match any criteria of the
    other plot types

    Args:
        xpoints: The x-axis values
        ypoints: The y-axis values

    Returns:
        A string with the name of the determined plot type
    """ # We represent categorical data as integer-valued data # First check whether all setpoints are identical along # any dimension # Now check if this is a simple rectangular sweep, # possibly interrupted in the middle of one row # this is the check that we are on a "simple" grid # this is the check that we are on an equidistant grid
A string with the name of the determined plot type
A string with the name of the determined plot type
xpoints
np.ndarray
The x-axis values
The x - axis values
ypoints
np.ndarray
The y-axis values
The y - axis values