-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manual creation of dataset #20
Comments
@peendebak @eendebakpt yeah, it must not be a dict, because iterating over a dict yelds keys and we clearly want to add the data_array. But actually the data is all there. |
the bug is in def _clean_array_ids(self, arrays), and precisely in the return statement. If any array has the same action_index then it will not exist in the action_id_map (whose meaning goes beyond my understanding). Maybe @alexcjohnson can shed some light on it ? |
@eendebakpt @peendebak I guess that any data create from the loop will always have different action ids. |
@giulioungaretti @alexcjohnson The following does work. The issue is indeed with the 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))
print('new data...')
dd = new_data(arrays=[], location=location)
dd.add_array(x)
dd.add_array(y)
dd.add_array(z)
return dd
d=DataSet2D()
print(d) |
@peendebak thanks for bringing this up. The bandaid solution to the But really, per my TODO we should get One difficulty with this, and the reason I think @MerlinSmiles used |
@alexcjohnson From a hdf5/h5py technical perspective the h5py Group works like a dictionary. The way I would encode this is by adding a list containing array_id's that contains the order of the arrays. That way it is easy to both store and extract in the proper order (in any case quite natural). Additionally I would like to have a good example dataset and a good test to see if two datasets are identical to see if I correctly write and read. (most importantly this test will tell me what actually defines the dataset) In microsoft/Qcodes#179 I am currently passing all tests for writing and saving simple data but I have not included things like the action id (which may explain why it does not yet work with the loop). The tests I use are based on the test_format, which tests the gnuplot formatter. tl;dr
|
microsoft/Qcodes#162 won't happen if the madness in action_id_map gets fixed, which in turn will probably fix this. |
The following code created a dataset, but only the
z
array is shown.There are two issues here:
x
andy
arrays do not show. This is something related to the.action_indices
arrays
should be adict
, but that generates an error@alexcjohnson @giulioungaretti
The text was updated successfully, but these errors were encountered: