Repository navigation
Add generic annotations to Keysight drivers - #8695
Draft
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 7 commits into
Draft
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 7 commits into
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 7 commits into
Conversation
The staircase sweep setup methods now convert their enum or int arguments before setting the parameters, and the B1517A one takes the WM post sweep condition rather than the B1520A WMDCV one.
Jens Hedegaard Nielsen (jenshnielsen)
requested a review
from a team
as a code owner
October 30, 2026 06:06
Jens Hedegaard Nielsen (jenshnielsen)
marked this pull request as draft
October 30, 2026 06:06
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8695 +/- ##
==========================================
+ Coverage 75.02% 75.08% +0.06%
==========================================
Files 307 307
Lines 32511 32545 +34
==========================================
+ Hits 24392 24438 +46
+ Misses 8119 8107 -12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
open and short were command-only parameters, so calling them without an argument, as the example does, returned the cached value and did not execute the correction.
Since NumericScpiMnemonic became a PEP 695 type alias, get_args returns an empty tuple for it, so "MIN", "MAX" and "DEF" were formatted as numbers and raised a ValueError.
Getting these parameters returns a number, but they can also be set to keywords such as MIN or MAX, which stay in the cache until the next get, so they are annotated as float | str and their docstrings say so.
Jens Hedegaard Nielsen (jenshnielsen)
requested a balanced review from Copilot
October 30, 2026 07:56
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new correction commands are defined as properties without required defaults, causing pyvisa-sim to fail loading and blocking all E4980A driver tests.
1 open issue
What changed in this PR
This PR improves parameter typing across QCoDeS Keysight drivers and makes E4980A correction calls execute instrument commands.
Changes:
- Add generic parameter annotations and explicit enum conversions to B1500 and B220x drivers.
- Replace E4980A OPEN and SHORT correction parameters with methods, with simulator support and regression tests.
- Document typing improvements and the correction API breaking change.
| File | Description |
|---|---|
| tests/drivers/test_keysight_e4980a.py | Test correction command dispatch and subsequent queries. |
| tests/drivers/keysight_b1500/b1500_driver_tests/test_b1517a_smu.py | Align enum usage and annotate intentional integer input. |
| src/qcodes/instrument/sims/Keysight_E4980A.yaml | Add simulated correction commands. |
| src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | Type enum parameters and convert setup arguments. |
| src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1517A.py | Type parameters and correct the post-sweep enum. |
| src/qcodes/instrument_drivers/Keysight/keysight_e4980a.py | Replace correction parameters with command methods. |
| src/qcodes/instrument_drivers/Keysight/keysight_b220x.py | Type integer and list parameters. |
| docs/changes/newsfragments/8695.improved_driver | Describe driver typing improvements. |
| docs/changes/newsfragments/8695.breaking | Explain correction API migration. |
Review effort: Balanced
Comment on lines
+53
to
+55
| correction_open: | ||
| setter: | ||
| q: ":CORRection:OPEN" |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.