Skip to content

Commit 99032fc

Browse files
authored
Remove some of the entries in allow_DeprecationWarning (Qiskit#12721)
* remove some of the entries * fixing obscure expcetion handleing for comparison * remove all the modules * ignore "Treating CircuitInstruction as an iterable is deprecated" in Aer * remove allow_DeprecationWarning_module and revert ignore/default * revert
1 parent 41267ec commit 99032fc

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

qiskit/circuit/instruction.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,12 @@ def __eq__(self, other):
188188
return False
189189

190190
for self_param, other_param in zip_longest(self.params, other.params):
191-
try:
191+
if isinstance(self_param, numpy.ndarray):
192+
if numpy.array_equal(self_param, other_param):
193+
continue
194+
else:
192195
if self_param == other_param:
193196
continue
194-
except ValueError:
195-
pass
196197

197198
try:
198199
self_asarray = numpy.asarray(self_param)

test/utils/base.py

-22
Original file line numberDiff line numberDiff line change
@@ -129,30 +129,8 @@ def setUpClass(cls):
129129
module=r"qiskit_aer(\.[a-zA-Z0-9_]+)*",
130130
)
131131

132-
allow_DeprecationWarning_modules = [
133-
"test.python.pulse.test_builder",
134-
"test.python.pulse.test_block",
135-
"test.python.quantum_info.operators.symplectic.test_legacy_pauli",
136-
"qiskit.quantum_info.operators.pauli",
137-
"pybobyqa",
138-
"numba",
139-
"qiskit.utils.measurement_error_mitigation",
140-
"qiskit.circuit.library.standard_gates.x",
141-
"qiskit.pulse.schedule",
142-
"qiskit.pulse.instructions.instruction",
143-
"qiskit.pulse.instructions.play",
144-
"qiskit.pulse.library.parametric_pulses",
145-
"qiskit.quantum_info.operators.symplectic.pauli",
146-
]
147-
for mod in allow_DeprecationWarning_modules:
148-
warnings.filterwarnings("default", category=DeprecationWarning, module=mod)
149132
allow_DeprecationWarning_message = [
150-
r"elementwise comparison failed.*",
151-
r"The jsonschema validation included in qiskit-terra.*",
152-
r"The DerivativeBase.parameter_expression_grad method.*",
153133
r"The property ``qiskit\.circuit\.bit\.Bit\.(register|index)`` is deprecated.*",
154-
# Caused by internal scikit-learn scipy usage
155-
r"The 'sym_pos' keyword is deprecated and should be replaced by using",
156134
]
157135
for msg in allow_DeprecationWarning_message:
158136
warnings.filterwarnings("default", category=DeprecationWarning, message=msg)

0 commit comments

Comments
 (0)