From b2338db7d26ef5144fbac7b0ba90015a8e1c3337 Mon Sep 17 00:00:00 2001 From: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> Date: Sat, 20 Jul 2024 10:15:36 -0400 Subject: [PATCH] Update ignore for latest mypy (#192) (cherry picked from commit bf5e90399ec7de0ca85902a81e45ca0566c11369) --- qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py b/qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py index 13684273..895a8fae 100644 --- a/qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py +++ b/qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py @@ -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 @@ -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",