microsoft / microsoft/Qcodes

Data from new dataset is mixed up

Open
#900 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new dataset
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

### Steps to reproduce
1. Create a measurement and get a reference to its dataset
```
meas = Measurement()
meas.registerParameter(dac.ch1) # register the first independent parameter
meas.registerParameter(dmm.v1, setpoints=(dac.ch1,)) # now register the dependent one

with meas.run() as datasaver:
datasaver._dataset.add_metadata('database', 'database')

for set_v in np.linspace(0, 25, 100):
dac.ch1.set(set_v)
get_v = dmm.v1.get()
datasaver.addResult((dac.ch1, set_v),
(dmm.v1, get_v))

dataid = datasaver.id # convenient to have for plotting

// why underscore the reference? I my view its perfectly reasonable to get the dataset directory from the datasaver.
ds = datasaver._dataset

```
2a. Get the independent axes
`ds.get_setpoints(ds.get_parameters()[0].name)`
2b.
`ds.get_setpoints(ds.get_parameters()[1].name)`

3a. Get the (in)dependent axes
`ds.get_data(ds.get_parameters()[0].name)`
3b.
`ds.get_data(ds.get_parameters()[1].name)`

### Expected behavior
2. Get a **single non-nested list** of the independent parameter setpoint, i.e. [s1, s2, s2, ....]
3. Get a **single non-nested list** of the (dependent) parameter values, i.e. [s1, s2, s2, ....]

### Actual behavior
2a. Fails with
`ValueError: Parameter dac_ch1 has no setpoints.`, which is ok, i guess?
2b. Returns
Got a **list in a list in a list**, i.e. [[[0, s2, s2, ....., 25]]], which does correspond to _dac.ch1.set(set_v)_

3a. Returns
.. a **list in a list** i.e. [0, s2, s3, .... 25], which seems to correspond to _dac.ch1.set(set_v)_
3b. Returns
.. a **list in a list** i.e. [4.911194874618999, s2, s3, .... 0.15320196425034593], which seems to correspond to _dmm.v1, get_v_, instead of _dac.ch1.set(set_v)_ unlike before under **point2b**.

The behavior of ds.get_data_ is consistent with _ds.get_values_ and with what I would expect.

### Feature request
1. Get the independent parameter setpoint values without knowing the name or using something like ParamSpec
`
// axes_id is the position of the parameter in the tuple given to datasaver.addResult()
ds.get_axes(int axes_id)
// or
ds.get_setpoints(int axes_id)
`
1. Get the dependent parameter values without knowing the name or using something like ParamSpec.
`
data = ds.get_data()
//data contains only the dependent (i.e. measured) parameters...
`

### System
**operating system**

**qcodes branch**
feature/dataset

**qcodes commit**

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Measurement, DataSaver, and Dataset APIs used in the reproduction, especially get_setpoints(), get_data(), and get_values(). Reproduce the nested and mismatched results with the shown addResult() sequence, then define and test consistent axis and dependent-value behavior, including the requested parameter-index access.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.