-
Notifications
You must be signed in to change notification settings - Fork 332
More type safe ways of gettting channel attributes #7486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8686990
to
6b6c99a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7486 +/- ##
=======================================
Coverage 59.73% 59.73%
=======================================
Files 347 347
Lines 31242 31249 +7
=======================================
+ Hits 18661 18666 +5
- Misses 12581 12583 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces more type-safe ways of getting channel attributes by improving type hints and adding a new deprecation warning for the get_channel_by_name
method when used with multiple names.
Key changes:
- Adds explicit type annotations for parameters in mock instrument classes
- Introduces a new
get_channels_by_name
method as a replacement for multi-name usage ofget_channel_by_name
- Improves type safety by adding runtime type assertions in test code
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
tests/test_channels.py | Adds type annotations, creates dedicated test class for channel lists, adds type assertions for better runtime type safety |
src/qcodes/instrument_drivers/mock_instruments/init.py | Adds explicit type annotations for all parameter attributes in mock instrument classes |
src/qcodes/instrument/channel.py | Implements new get_channels_by_name method and deprecation warning for multi-name usage of get_channel_by_name |
docs/changes/newsfragments/7486.breaking | Documents the breaking change and deprecation |
No description provided.