Skip to content

Conversation

@jenshnielsen
Copy link
Collaborator

@jenshnielsen jenshnielsen commented Dec 16, 2025

Make parameter generic in data and instrument type. This enables significantly better introspection of qcodes instruments and their data returned from parameters.

This takes the core infrastructure changes from #7655 and breaks it out into a pr with clean commits. The instrument improvements will land independently. Consult that pr for examples of improvements.

  • Changelog

@jenshnielsen jenshnielsen requested a review from a team as a code owner December 16, 2025 09:33
@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 30.13699% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.88%. Comparing base (d825f1b) to head (7025c17).
⚠️ Report is 133 commits behind head on main.

Files with missing lines Patch % Lines
src/qcodes/parameters/parameter_base.py 55.55% 16 Missing ⚠️
src/qcodes/parameters/delegate_parameter.py 8.33% 11 Missing ⚠️
src/qcodes/parameters/cache.py 10.00% 9 Missing ⚠️
src/qcodes/parameters/parameter.py 0.00% 5 Missing ⚠️
src/qcodes/parameters/parameter_with_setpoints.py 0.00% 4 Missing ⚠️
src/qcodes/parameters/array_parameter.py 0.00% 3 Missing ⚠️
src/qcodes/parameters/multi_parameter.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7730      +/-   ##
==========================================
- Coverage   59.89%   59.88%   -0.01%     
==========================================
  Files         352      352              
  Lines       31806    31843      +37     
==========================================
+ Hits        19051    19070      +19     
- Misses      12755    12773      +18     

☔ 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 jenshnielsen force-pushed the generic_parameter branch 2 times, most recently from 1ec9054 to 12463a1 Compare January 1, 2026 08:41
Copy link
Contributor

@astafan8 astafan8 left a comment

Choose a reason for hiding this comment

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

Even though the type system is not as powerful for supporting this feature, and the internals of qcodes are not as cleanly implemented, this is still probably a useful addition to make towards better typed driver code and hence measurement code, so let's give it a go by the users :)

jenshnielsen and others added 3 commits January 30, 2026 14:50
@jenshnielsen
Copy link
Collaborator Author

Even though the type system is not as powerful for supporting this feature, and the internals of qcodes are not as cleanly implemented, this is still probably a useful addition to make towards better typed driver code and hence measurement code, so let's give it a go by the users :)

I think this undersells the feature a bit ;)

Consult #7822 for some of the improvements this gives.
such as being able to statically match on all possible values of a parameter:

image

@jenshnielsen jenshnielsen added this pull request to the merge queue Jan 30, 2026
Merged via the queue into microsoft:main with commit b41cb4a Jan 30, 2026
16 of 18 checks passed
@jenshnielsen jenshnielsen deleted the generic_parameter branch January 30, 2026 15:36
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.

2 participants