Skip to content

Switch float to permissive int for parameter validators and add types - #8678

Merged
Jens Hedegaard Nielsen (jenshnielsen) merged 10 commits into
microsoft:mainfrom
jenshnielsen:add_parameter_annotations_2
Oct 27, 2026
Merged

Jens Hedegaard Nielsen (jenshnielsen) merged 10 commits into
microsoft:mainfrom
jenshnielsen:add_parameter_annotations_2

Conversation

@jenshnielsen

Copy link
Copy Markdown
Collaborator

No description provided.

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.02%. Comparing base (572851c) to head (2657f9e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8678   +/-   ##
=======================================
  Coverage   75.02%   75.02%           
=======================================
  Files         307      307           
  Lines       32506    32506           
=======================================
+ Hits        24386    24389    +3     
+ Misses       8120     8117    -3     

☔ View full report in Codecov by Harness.
📢 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.

The averaging factor is an integer from 1 to 999. Previously
set_parser=int silently truncated values like 2.5.
The value is a range number, 1 for low and 2 for high, not a current.
Dwell, pause, curve number and excitation range number are integers
in the INSET and INTYPE commands.
The trigger mode and number of waveform points have no unit, and the
waveform y origin and reference are in digitizing levels, not volts.
@jenshnielsen Jens Hedegaard Nielsen (jenshnielsen) changed the title [WIP] Switch float to permissive int for parameter validators and add types Switch float to permissive int for parameter validators and add types Oct 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review found no blocking issues in these localized changes, which include targeted regression tests; tests were not executed.

No open issues 🎉

What changed in this PR

Tightens validation for integer-valued instrument settings while preserving support for whole-number floats and serializing them as integers.

Changes:

  • Uses PermissiveInts with integer serialization across five drivers and adds parameter type annotations.
  • Adds regression tests for whole-number float acceptance and fractional-value rejection.
  • Corrects parameter units and a label, and documents the changes in a newsfragment.
File Description
tests/​drivers/​test_rigol_dg1062.py Tests burst cycle validation and integer serialization.
tests/​drivers/​test_lakeshore_372.py Tests validation and serialization for four channel settings.
tests/​drivers/​test_keithley_7510.py Tests averaging count validation and serialization.
tests/​drivers/​test_coppermountain_m5065.py Tests averaging validation, including fractional-value rejection.
tests/​drivers/​test_aimtti_pl601p.py Tests current-range validation and serialization.
src/​qcodes/​instrument_drivers/​rigol/​Rigol_DS1074Z.py Removes incorrect parameter units.
src/​qcodes/​instrument_drivers/​rigol/​Rigol_DG1062.py Validates and serializes burst cycles as integers.
src/​qcodes/​instrument_drivers/​Lakeshore/​Lakeshore_model_372.py Tightens integer-setting validation and corrects a label.
src/​qcodes/​instrument_drivers/​Keithley/​Keithley_7510.py Tightens averaging count validation and serialization.
src/​qcodes/​instrument_drivers/​CopperMountain/​_M5xxx.py Types the averaging parameter and rejects fractional counts.
src/​qcodes/​instrument_drivers/​AimTTi/​_AimTTi_PL_P.py Types and validates current-range selection; removes its incorrect unit.
docs/​changes/​newsfragments/​8678.improved_driver Documents validation and metadata corrections.

Review effort: Balanced

Comment thread docs/changes/newsfragments/8678.improved_driver
@jenshnielsen
Jens Hedegaard Nielsen (jenshnielsen) marked this pull request as ready for review October 27, 2026 11:42
Merged via the queue into microsoft:main with commit b7ac5bc Oct 27, 2026
19 checks passed
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.

3 participants