Snapshot of ScaledParameter doesn't update when wrapped parameter is set
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 459
- Forks
- 359
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 73
Description
Steps to reproduce
- Create ScaledParameter
- Change value of wrapped parameter
- Take snapshot of ScaledParameter. => It contains the old value
Expected behaviour
It is expected that also the snapshot of the ScaledParameter reflects the latest value of the wrapped behavior.
Actual behaviour
Snapshot of ScaledParameter is not updated.
System
Windows
qcodes release 0.21
Example to reproduce:
import qcodes as qc
from qcodes.tests.instrument_mocks import DummyInstrument
from pprint import pprint
iv_converter = DummyInstrument('iv_converter', gates=('adc1',))
current1 = qc.ScaledParameter(output=iv_converter.adc1, gain=1/1e6, name='current1', unit='A')
# This works fine
current1(4e-6)
pprint(current1.snapshot()) # this snapshot is correct
# Set adc1 to 3
iv_converter.adc1(3)
pprint(current1.snapshot()) # this snapshot "value" is not correct (old value)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ScaledParameter, its snapshot() method, and the wrapped DummyInstrument adc1 parameter shown in the reproduction. Reproduce the sequence of setting current1, changing adc1, and taking another snapshot; done means the second ScaledParameter snapshot reflects the wrapped parameter's latest value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100