Feature/mypy and formatting#217
Conversation
- requires-python: >=3.9,<3.13 → >=3.10,<3.14 - CI matrix: ["3.9"..."3.12"] → ["3.10"..."3.13"] - black target-version: py39 → py310 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
quam_test.yaml becomes a thin dispatcher; all matrix defaults live in run_tests.yaml so they are defined in one place. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
…pressions In mypy 2.1.0, type: ignore on the opening line of a parenthesized multi-line expression does not suppress errors on continuation lines. Collapse affected patterns to single lines and fix MigrateBase and callback arg-type suppressions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tPulse Instead of suppressing the mypy error, validate at runtime that the looked-up pulse is actually a BaseReadoutPulse and raise a clear ValueError if not. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- channels.py: replace type: ignore[operator] with elif/else restructure that lets mypy narrow Optional[int] to int; replace unreachable branch with explicit raise ValueError - pulses.py: replace type: ignore[arg-type] on float tuple case with isinstance checks on both elements; keep type: ignore[assignment] for ndarray case which is intentionally outside the declared return union - Add tests for calculate_waveform covering float tuple and ndarray tuple inputs, verified to produce identical results before and after changes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ure/mypy_and_formatting
| try: | ||
| elems = port_reference.split("/") | ||
| port_type, controller_id, port_id = elems[-3:] | ||
| port_type_str, controller_id_str, port_id_str = elems[-3:] |
There was a problem hiding this comment.
why adding str to the name? if we want to show its str isnt it enough to type hint?
There was a problem hiding this comment.
Previously the code reused the same name — assigning a str, then reassigning an int/Union[str,int] to it. mypy can't support it.
| self, | ||
| attr: Optional[str] = None, | ||
| relative_path: Optional[str] = None, | ||
| follow_chain: bool = False, |
There was a problem hiding this comment.
i see its a new variable but i dont see where its used, is it used in the function?
There was a problem hiding this comment.
Its to match the base class signature. Added documentation and exception in case its used
|
seems like a lot of code repetition but I assume its not the pr goal since it was there before |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document that follow_chain is accepted only for signature compatibility with QuamBase, and raise NotImplementedError when a caller actually requests chain-following on a root (rather than silently ignoring it). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fix two black --check failures surfaced by the new lint job: - quam_classes.py: collapse single-line raise NotImplementedError - general.py: split long __all__ list (pre-existing, from collect_package_versions) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
No description provided.