Skip to content

Fix mypy type error in MWFEMAnalogInputPort.get_port_properties - #224

Merged
yomach merged 1 commit into
mainfrom
fix/mwfem-port-properties-mypy
Jul 29, 2026
Merged

Fix mypy type error in MWFEMAnalogInputPort.get_port_properties#224
yomach merged 1 commit into
mainfrom
fix/mwfem-port-properties-mypy

Conversation

@yomach

@yomach yomach commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes a pre-existing mypy error in quam/components/ports/analog_inputs.py that fails the lint job's mypy step on every PR (e.g. run 30467312812).
  • The error was introduced in support lo mode in quam #211 (adding lo_mode), but only started failing CI once Feature/mypy and formatting #217 added the mypy check to the lint job. port_properties was an untyped dict literal, so mypy inferred its value type from the initial int/float/bool entries (joining to float), then rejected the later lo_mode: Literal["auto", "always_on"] assignment. Annotating it as Dict[str, Any] (matching the function's own declared return type) fixes it — no behavior change.

Test plan

  • mypy quam/ --ignore-missing-imports --follow-imports=silent — 0 errors (was 1)
  • black --check quam/ — unchanged, passes
  • pflake8 quam/ — passes

🤖 Generated with Claude Code

https://claude.ai/code/session_01BSjkz5MSzwofzPG8vKfcA2

port_properties was an untyped dict literal, so mypy inferred its
value type from the initial int/float/bool entries (joined to float),
then rejected the later lo_mode Literal["auto", "always_on"] assignment.
Annotate it as Dict[str, Any] to match the function's declared return type.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BSjkz5MSzwofzPG8vKfcA2
@yomach
yomach merged commit 02b3566 into main Jul 29, 2026
8 checks passed
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.

1 participant