Skip to content

Conversation

jenshnielsen
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.73%. Comparing base (e68ff37) to head (357fbde).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
src/qcodes/instrument/channel.py 66.66% 3 Missing ⚠️
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.
📢 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 changed the title [WIP] More type safe ways of gettting channel attributes More type safe ways of gettting channel attributes Sep 19, 2025
@jenshnielsen jenshnielsen marked this pull request as ready for review September 19, 2025 12:28
@jenshnielsen jenshnielsen requested a review from a team as a code owner September 19, 2025 12:28
Copy link
Contributor

@Copilot Copilot AI left a 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 of get_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

@jenshnielsen jenshnielsen added this pull request to the merge queue Sep 22, 2025
Merged via the queue into microsoft:main with commit c33349a Sep 22, 2025
16 checks passed
@jenshnielsen jenshnielsen deleted the channel_type_safe branch September 22, 2025 09:14
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