microsoft / microsoft/Qcodes

Provide interface for parameters to announce their interdependencies

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

Description

Currently [DelegateParameter](https://github.com/microsoft/Qcodes/blob/main/src/qcodes/parameters/delegate_parameter.py) (and potentially other classes) implement an interface that allows users to create a parameter that delegates to other parameters. However, when such a parameter is used in a measurement either as a sweeped or as a measured parameter we only captures the values of the delegate parameter. Reconstructing the values of the underlying parameter is only possible by looking at the snapshot of the parameter to find properties such as scale and offset and manually calculate the values of the underlying parameter(s). This makes it hard to reconstruct a delegate mapping more complex than scale and offset and makes the underlying data harder to audit (e.g. what were the actual values set on the instrument).

QCoDeS already provides an interface for allowing parameters to declare that they are inderred from another parameter.
This card is to track defining an interface on `ParameterBase` such that a Parameter can declare that it can be infeered from a set of parameters. This can take the form of

```
def inferences(self) -> Tuple[ParameterBase,...]
# error handling missing
return (self,).extend(self.source.inferences)
```
or something similar.

Once this is resolved https://github.com/microsoft/Qcodes/issues/7064 can be tackled to make use of this interface to automatically capture data.

Note that for this to be useful the bug reported in https://github.com/microsoft/Qcodes/issues/7051 should be resolved first.

Contributor guide

Open the contributing guide

Research direction

Start by reading src/qcodes/parameters/delegate_parameter.py and the existing interface for parameters inferred from other parameters. Define and document the ParameterBase interface for declaring inference dependencies, including error handling and nested delegates; done when the interface is suitable for the later data-capture work in issue 7064.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.