Skip to content

Use typed parameter kwargs in drivers#8051

Draft
jenshnielsen wants to merge 17 commits intomicrosoft:mainfrom
jenshnielsen:use_typed_parameter
Draft

Use typed parameter kwargs in drivers#8051
jenshnielsen wants to merge 17 commits intomicrosoft:mainfrom
jenshnielsen:use_typed_parameter

Conversation

@jenshnielsen
Copy link
Copy Markdown
Collaborator

No description provided.

jenshnielsen and others added 15 commits April 16, 2026 14:40
Update TraceParameter, SweepTraceParameter to use Unpack[ParameterKWArgs]
and FrequencySweep to use Unpack[ParameterBaseKWArgs], removing explicit
instrument parameter in favor of flowing it through the typed kwargs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update _ParameterWithStatus to use Unpack[ParameterKWArgs].

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update S46Parameter to use Unpack[ParameterKWArgs] with concrete instrument
type. Update DataArray7510 to use Unpack[ParameterBaseKWArgs] and
GeneratedSetPoints to use Unpack[ParameterKWArgs] with explicit name param.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update _ParameterWithStatus, SamplingMeasurement, IVSweepMeasurement,
and KeysightB1500CVSweepMeasurement to use Unpack[ParameterKWArgs] or
Unpack[ParameterBaseKWArgs] with concrete instrument types, removing
explicit instrument parameters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update DSOTimeAxisParam, DSOFrequencyAxisParam to use
Unpack[ParameterKWArgs] with explicit name param. Update DSOTraceParam
to use Unpack[ParameterKWArgs] with concrete instrument union type,
removing explicit instrument parameter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update PNAAxisParameter and FormattedSweep to use Unpack[ParameterKWArgs]
with explicit name param and concrete instrument types, removing explicit
instrument/label/unit parameters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update FrequencyAxis and Trace to use Unpack[ParameterKWArgs] with
generic instrument type params and explicit name param, replacing
*args: Any.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update KeysightE4980AMeasurementPair to use Unpack[ParameterBaseKWArgs].

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update TimeTrace to use Unpack[ParameterKWArgs] with concrete
Keysight344xxA instrument type, removing explicit instrument parameter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update SR830 ChannelTrace and GeneratedSetPoints to use
Unpack[ParameterKWArgs]. Update SR86x SR86xBufferReadout to use
Unpack[ParameterBaseKWArgs], removing explicit instrument parameter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update ZNB (6 parameter subclasses) and RTO1000 ScopeTrace to use
Unpack[ParameterBaseKWArgs] with concrete instrument types, removing
explicit instrument parameters and extracting instrument via
kwargs.get() + assert when needed before super().__init__().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update ScopeArray to use Unpack[ParameterBaseKWArgs] with concrete
TPS2012Channel instrument type.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update FrequencySweepMagPhase, PointMagPhase, and PointIQ to use
Unpack[ParameterBaseKWArgs] with concrete CopperMountainM5xxx instrument
type, extracting instrument via kwargs.get() + assert for label building
before super().__init__().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update QDevQDacMultiChannelParameter to use Unpack[ParameterBaseKWArgs]
with concrete QDevQDacChannel instrument type.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update ~12 parameter subclasses (DmmExponentialParameter,
DmmGaussParameter, MultiSetPointParam, Multi2DSetPointParam,
Multi2DSetPointParam2Sizes, MultiScalarParam, ArraySetPointParam,
ComplexArraySetPointParam, GeneratedSetPoints,
DummyParameterWithSetpoints1D/2D/Complex) to use
Unpack[ParameterKWArgs] or Unpack[ParameterBaseKWArgs] with concrete
instrument types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 91.59664% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.76%. Comparing base (12dc208) to head (e40c401).

Files with missing lines Patch % Lines
src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py 0.00% 12 Missing ⚠️
...rc/qcodes/instrument_drivers/Keysight/Infiniium.py 40.00% 3 Missing ⚠️
src/qcodes/instrument_drivers/Keysight/N52xx.py 0.00% 2 Missing ⚠️
...ent_drivers/signal_hound/SignalHound_USB_SA124B.py 60.00% 2 Missing ⚠️
...odes/instrument_drivers/stanford_research/SR830.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8051      +/-   ##
==========================================
- Coverage   70.59%   69.76%   -0.84%     
==========================================
  Files         333      333              
  Lines       32490    32676     +186     
==========================================
- Hits        22936    22795     -141     
- Misses       9554     9881     +327     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

jenshnielsen and others added 2 commits April 16, 2026 15:37
…etpoints kwargs

Add ArrayParameterKWArgs, MultiParameterKWArgs, and ParameterWithSetpointsKWArgs
TypedDicts to document and type-check keyword arguments for these parameter classes.
Export all three from qcodes.parameters.__init__.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update ParameterWithSetpoints subclasses in instrument drivers to use
Unpack[ParameterWithSetpointsKWArgs] instead of **kwargs: Any for
improved type safety and documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant