microsoft / microsoft/Qcodes

[feature request] get_parameter_data option to not return setpoints

Open
#1,601 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

In the case of a `Multiparameter` with many internal setpoints that stay constant while an external setpoint is swept, the output of `Dataset.get_parameter_data` can get unwieldy. A useful option would be to only return setpoints once, then something similar to `Dataset.get_data`.

```python
import qcodes as qc
from qcodes import MultiParameter, Measurement, Parameter
from qcodes.dataset.data_set import load_by_id
import numpy as np

qc.new_experiment(name='get_data_issue', sample_name='none')

class MockMultiParam(MultiParameter):
def __init__(self):
super().__init__("multiparam", names=('A','B'), shapes=((100,),)*2, setpoints = ((np.arange(100),),)*2, setpoint_names = (('t',),)*2 )
self.i = 0

def get_raw(self):
val = (np.arange(100) + self.i*10*100,)*2
self.i +=1
return val

mock_param = MockMultiParam()
t2_param = Parameter('t2', set_cmd=None, get_cmd=None)

meas = Measurement()
meas.register_parameter(t2_param)
meas.register_parameter(mock_param, paramtype='array', setpoints=(t2_param,))

with meas.run() as datasaver:
for t2 in range(10):
datasaver.add_result((t2_param, t2), (mock_param, mock_param()))
run_id = datasaver.run_id

ds = load_by_id(run_id)

print(ds.get_data('B'))
print(ds.get_parameter_data('B'))
```

Contributor guide

Open the contributing guide

Research direction

Start with the Dataset.get_parameter_data and Dataset.get_data entry points shown in the example, then reproduce the Multiparameter case using the provided script and compare both outputs. Done means an optional behavior can avoid repeating constant internal setpoints while preserving the existing default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.