Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin numpy<2.2.0 #649

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Pin numpy<2.2.0 #649

merged 1 commit into from
Dec 13, 2024

Conversation

t-imamichi
Copy link
Collaborator

@t-imamichi t-imamichi commented Dec 12, 2024

Summary

numpy 2.2.0 was released recently and it causes mypy errors as follows.
In order to merge existing PRs, I would like to pin numpy version first.
After we merge all existing PRs, we get back to these mypy errors.

I feel the error does not make sense because tuple[int, int] should be matched tuple[int, ...].

qiskit_optimization/converters/linear_inequality_to_penalty.py:218: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int], dtype[Any]]")  [assignment]
qiskit_optimization/converters/linear_inequality_to_penalty.py:221: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int], dtype[Any]]")  [assignment]
qiskit_optimization/converters/linear_inequality_to_penalty.py:227: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int], dtype[Any]]")  [assignment]
qiskit_optimization/converters/linear_equality_to_penalty.py:144: error: Argument 1 to "extend" of "list" has incompatible type "str"; expected "Iterable[float]"  [arg-type]
qiskit_optimization/converters/linear_equality_to_penalty.py:144: note: Following member(s) of "str" have conflicts:
qiskit_optimization/converters/linear_equality_to_penalty.py:144: note:     Expected:
qiskit_optimization/converters/linear_equality_to_penalty.py:144: note:         def __iter__(self) -> Iterator[float]
qiskit_optimization/converters/linear_equality_to_penalty.py:144: note:     Got:
qiskit_optimization/converters/linear_equality_to_penalty.py:144: note:         def __iter__(self) -> Iterator[str]
qiskit_optimization/algorithms/admm_optimizer.py:860: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], Any]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]
qiskit_optimization/algorithms/admm_optimizer.py:861: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], Any]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]
qiskit_optimization/algorithms/admm_optimizer.py:862: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], Any]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]
Found 7 errors in 3 files (checked 126 source files)

Details and comments

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12290037198

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.865%

Totals Coverage Status
Change from base Build 12172129732: 0.0%
Covered Lines: 4451
Relevant Lines: 4793

💛 - Coveralls

Copy link
Collaborator

@Dniskk Dniskk left a comment

Choose a reason for hiding this comment

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

LGTM

@t-imamichi t-imamichi added automerge stable backport potential The bug might be minimal and/or import enough to be port to stable labels Dec 13, 2024
@mergify mergify bot merged commit a962c45 into qiskit-community:main Dec 13, 2024
18 checks passed
mergify bot pushed a commit that referenced this pull request Dec 13, 2024
(cherry picked from commit a962c45)
mergify bot added a commit that referenced this pull request Dec 13, 2024
(cherry picked from commit a962c45)

Co-authored-by: Takashi Imamichi <[email protected]>
@t-imamichi t-imamichi deleted the pin-numpy branch December 13, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge stable backport potential The bug might be minimal and/or import enough to be port to stable type: ci Related to CI changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants