Skip to content

fix(visualization): update ylim function call for consistency#773

Merged
PabloCarmona merged 1 commit into
masterfrom
fix-mypy-visualization
Jun 15, 2026
Merged

fix(visualization): update ylim function call for consistency#773
PabloCarmona merged 1 commit into
masterfrom
fix-mypy-visualization

Conversation

@PabloCarmona

Copy link
Copy Markdown
Collaborator

Description

Address recent mypy errors on visualization matplotlib module:

mypy --show-error-codes src/
src/aihwkit/utils/visualization.py:635: error: No overload variant of "ylim" matches argument type "list[int]"  [call-overload]
src/aihwkit/utils/visualization.py:635: note: Possible overload variants:
src/aihwkit/utils/visualization.py:635: note:     def ylim() -> tuple[float, float]
src/aihwkit/utils/visualization.py:635: note:     def ylim(bottom: float | tuple[float, float] | None = ..., top: float | None = ..., *, emit: bool = ..., auto: bool | None = ..., ymin: float | None = ..., ymax: float | None = ...) -> tuple[float, float]

Details

Passing -1, 1 as separate float-compatible arguments matches the overload signature ylim(bottom, top). A list[int] technically satisfied the tuple[float, float] variant in older mypy versions via looser checking, but newer mypy is stricter about the distinction between list and tuple.

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.ylim.html

@PabloCarmona PabloCarmona self-assigned this Jun 15, 2026
Signed-off-by: Pablo Carmona Gonzalez <pablocarmonagonzalez@gmail.com>
@PabloCarmona PabloCarmona force-pushed the fix-mypy-visualization branch from 5bc0a37 to d46707e Compare June 15, 2026 11:35
@PabloCarmona PabloCarmona merged commit 38abf1c into master Jun 15, 2026
11 of 13 checks passed
@PabloCarmona PabloCarmona deleted the fix-mypy-visualization branch June 15, 2026 11:51
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