Skip to content

Commit

Permalink
Update ignore for latest mypy (#192)
Browse files Browse the repository at this point in the history
(cherry picked from commit bf5e903)
  • Loading branch information
woodsp-ibm authored and mergify[bot] committed Jul 20, 2024
1 parent 35ac96a commit b2338db
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of a Qiskit project.
#
# (C) Copyright IBM 2022, 2023.
# (C) Copyright IBM 2022, 2024.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -236,7 +236,11 @@ def compute_minimum_eigenvalue(
# pick maximum gradient
max_grad_index, max_grad = max( # type: ignore[assignment]
enumerate(cur_grads),
key=lambda item: np.abs(item[1][0]), # type: ignore[call-overload]
# mypy <= 1.10 needs call-overload, for 1.11 its arg-type to suppress the error
# below then the other is seen as unused hence the additional unused-ignore
key=lambda item: np.abs(
item[1][0] # type: ignore[arg-type, unused-ignore]
), # type: ignore[call-overload, unused-ignore]
)
logger.info(
"Found maximum gradient %s at index %s",
Expand Down

0 comments on commit b2338db

Please sign in to comment.