Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ParameterWithSetpoints with DelegateParameter as setpoints

Open
#7,637 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start at Measurement.register_parameter and the dataset dependency validation that produces the shown ValueError. Examine whether nested ParameterWithSetpoints dependencies can be represented without treating them as a two-dimensional setpoint grid, and whether the current dataset structure supports the proposed time-axis/ramp model. Done means a clear feasibility or design decision for this dependency model.

Written by the indexing model from the issue text.

Description

The following setup is disallowed by qcodes:

from qcodes.validators import Arrays
from qcodes.parameters import Parameter, ParameterWithSetpoints
from qcodes.dataset import Measurement

p=Parameter('p', vals=Arrays(shape=(10,)), get_cmd=lambda : np.arange(10))
ps1 = ParameterWithSetpoints('ps1', vals=p.vals, setpoints=(p,), get_cmd=lambda : np.linspace(0, 1, 10))
ps2 = ParameterWithSetpoints('ps2', vals=p.vals, setpoints=(ps1,), get_cmd=lambda : np.random.randn(10))

meas = Measurement()
meas.register_parameter(ps2)
# ValueError: Paramspec ps1 both depends on ['p'] and is depended upon by ['ps2'] 
# This was caused while adding these interdependencies {ParamSpecBase('ps1', 'array', 'ps1', ''): (ParamSpecBase('p', 'array', 'p', ''),)}

When instead ps2 has a DelegateParameter as setpoints that points to ps1, the measurement works (but probably shouldn't according to the current logic):

from qcodes.parameters import DelegateParameter
dp = DelegateParameter('dp', source=ps1)
ps2.setpoints = (dp,)

meas = Measurement()
meas.register_parameter(ps2)  # p is just forgotten about here

Finally, I'm wondering if the dual dependency should not indeed be allowed. Take a ParameterWithSetpoints whose setpoints are maybe some voltages that are being ramped. We could want to attach time stamp information to the voltage ramp (maybe the measurement of the ParameterWithSetpoints is not continuous, but only during certain windows of the ramp), the natural way of doing which would be to make the voltage ramp a ParameterWithSetpoints itself, with setpoints given by the time stamps. I.e., ps2 -> measured_data, ps1 -> voltage_ramp, p -> time_axis. Another conceivable option would be to define the time stamps also as setpoints of the measured data parameter (ps2), but this is also illegal (two setpoint params imply a 2d setpoint grid rather than two independent setpoints).

The first question here would be if this is even possible with the current dataset structure.

Dominant language
Python
Stars
459
Forks
359
Avg merge
2d 10h
Merged PRs (30d)
79

Getting set up

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.

More from microsoft/Qcodes

All issues in microsoft/Qcodes

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.