Skip to content

Generic parameter - #7730

Merged
Jens Hedegaard Nielsen (jenshnielsen) merged 12 commits into
microsoft:mainfrom
jenshnielsen:generic_parameter
Jan 30, 2026
Merged

Jens Hedegaard Nielsen (jenshnielsen) merged 12 commits into
microsoft:mainfrom
jenshnielsen:generic_parameter

Conversation

@jenshnielsen

@jenshnielsen Jens Hedegaard Nielsen (jenshnielsen) commented Dec 16, 2025 •

Copy link
Copy Markdown
Collaborator

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

@codecov

codecov Bot commented Dec 16, 2025 •

Copy link
Copy Markdown

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.

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.

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 :)

Comment thread src/qcodes/parameters/parameter_base.py Resolved
Comment thread src/qcodes/parameters/parameter_base.py Resolved
Comment thread src/qcodes/parameters/parameter.py Resolved
Comment thread src/qcodes/parameters/cache.py Resolved
@jenshnielsen

Copy link
Copy Markdown
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

Merged via the queue into microsoft:main with commit b41cb4a Jan 30, 2026
16 of 18 checks passed
@jenshnielsen
Jens Hedegaard Nielsen (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