Skip to content

manual creation of dataset #20

Description

@peendebak

The following code created a dataset, but only the z array is shown.

There are two issues here:

import qcodes
from qcodes.tests.data_mocks import *

def DataSet2D(location=None):
    # DataSet with one 2D array with 4 x 6 points
    yy, xx = numpy.meshgrid(range(4), range(6))
    zz = xx**2+yy**2
    # outer setpoint should be 1D
    xx = xx[:, 0]
    x = DataArray(name='x', array_id='x', label='X', preset_data=xx, is_setpoint=True)
    y = DataArray(name='y', array_id='y',  label='Y', preset_data=yy, set_arrays=(x,),
                  is_setpoint=True)
    z = DataArray(name='z',  array_id='z', label='Z', preset_data=zz, set_arrays=(x, y))
    #return new_data(arrays={'x': x, 'y': y, 'z': z}, location=location) # this would fail
    return new_data(arrays=[x,y,z], location=location)

d=DataSet2D()
print(d)

@alexcjohnson @giulioungaretti

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions