microsoft / microsoft/Qcodes

DelegateParameter does not use source validator

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

Description

DelegateParameter currently does not take the validator of the source parameter. Especially, when using with a complex number parameter the DelegateParameter will default to a Floating point validator rather than using the complex numbers of the source.

Work around is easy in the initialization by using:
`Myparam = DelegateParameter('Myparam', source=source, vals=source.vals)`
However, I think this should be the default behavior of the DelegateParameter class rather than explicitly required by the user to pass in the `vals` argument.

### System
**operating system**
Windows

**qcodes branch**
v0.20.1

Contributor guide

Open the contributing guide

Research direction

Start by locating the DelegateParameter class and tracing how its validator is selected when a source parameter is provided. Compare this with a complex-number source and add a regression test showing that the delegated parameter uses the source's vals by default; the test should pass without explicitly supplying vals.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.