Skip to content

Commit 4c46615

Browse files
Update ignore for latest mypy (backport #192) (#193)
Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
1 parent 35ac96a commit 4c46615

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This code is part of a Qiskit project.
22
#
3-
# (C) Copyright IBM 2022, 2023.
3+
# (C) Copyright IBM 2022, 2024.
44
#
55
# This code is licensed under the Apache License, Version 2.0. You may
66
# obtain a copy of this license in the LICENSE.txt file in the root directory
@@ -236,7 +236,11 @@ def compute_minimum_eigenvalue(
236236
# pick maximum gradient
237237
max_grad_index, max_grad = max( # type: ignore[assignment]
238238
enumerate(cur_grads),
239-
key=lambda item: np.abs(item[1][0]), # type: ignore[call-overload]
239+
# mypy <= 1.10 needs call-overload, for 1.11 its arg-type to suppress the error
240+
# below then the other is seen as unused hence the additional unused-ignore
241+
key=lambda item: np.abs(
242+
item[1][0] # type: ignore[arg-type, unused-ignore]
243+
), # type: ignore[call-overload, unused-ignore]
240244
)
241245
logger.info(
242246
"Found maximum gradient %s at index %s",

0 commit comments

Comments
 (0)