Skip to content

Feature/mypy and formatting#217

Merged
natangqm merged 21 commits into
mainfrom
feature/mypy_and_formatting
Jun 28, 2026
Merged

Feature/mypy and formatting#217
natangqm merged 21 commits into
mainfrom
feature/mypy_and_formatting

Conversation

@natangqm

@natangqm natangqm commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

natangqm and others added 10 commits May 31, 2026 17:56
- 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>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

natangqm and others added 8 commits June 1, 2026 10:52
…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>
try:
elems = port_reference.split("/")
port_type, controller_id, port_id = elems[-3:]
port_type_str, controller_id_str, port_id_str = elems[-3:]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why adding str to the name? if we want to show its str isnt it enough to type hint?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously the code reused the same name — assigning a str, then reassigning an int/Union[str,int] to it. mypy can't support it.

Comment thread quam/components/ports/ports_containers.py
Comment thread quam/core/quam_classes.py
self,
attr: Optional[str] = None,
relative_path: Optional[str] = None,
follow_chain: bool = False,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see its a new variable but i dont see where its used, is it used in the function?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its to match the base class signature. Added documentation and exception in case its used

@Elad-Zaharan

Copy link
Copy Markdown
Collaborator

seems like a lot of code repetition but I assume its not the pr goal since it was there before

natangqm and others added 3 commits June 22, 2026 09:32
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>
@natangqm natangqm merged commit 8bfc849 into main Jun 28, 2026
6 of 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.

3 participants