Skip to content

Commit

Permalink
Add pylint disable rather than change arg name
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseclectic committed May 30, 2024
1 parent 2b2a1f3 commit 5f9acf0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions qiskit_aer/backends/aerbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ def _convert_binds(self, circuits, parameter_binds, idx_maps=None):
]
return parameterizations

# pylint: disable=arguments-differ
def run(self, run_input, validate=False, parameter_binds=None, **run_options):
# pylint: disable=arguments-renamed
def run(self, circuits, validate=False, parameter_binds=None, **run_options):
"""Run circuits on the backend.
Args:
run_input (QuantumCircuit or list): The QuantumCircuit (or list
circuits (QuantumCircuit or list): The QuantumCircuit (or list
of QuantumCircuit objects) to run
validate (bool): validate the Qobj before running (default: False).
parameter_binds (list): A list of parameter binding dictionaries.
Expand Down Expand Up @@ -182,10 +182,10 @@ def run(self, run_input, validate=False, parameter_binds=None, **run_options):
Raises:
ValueError: if run is not implemented
"""
if isinstance(run_input, (QuantumCircuit, Schedule, ScheduleBlock)):
run_input = [run_input]
if isinstance(circuits, (QuantumCircuit, Schedule, ScheduleBlock)):
circuits = [circuits]

if isinstance(run_input, (QasmQobj, PulseQobj)):
if isinstance(circuits, (QasmQobj, PulseQobj)):
warnings.warn(
"Using a qobj for run() is deprecated as of qiskit-aer 0.14"
" and will be removed no sooner than 3 months from that release"
Expand All @@ -202,19 +202,19 @@ def run(self, run_input, validate=False, parameter_binds=None, **run_options):
# run_options fields will take precidence over the value for those
# fields that are set via assemble.
if not run_options:
run_options = run_input.config.__dict__
run_options = circuits.config.__dict__
else:
run_options = copy.copy(run_options)
for key, value in run_input.config.__dict__.items():
for key, value in circuits.config.__dict__.items():
if key not in run_options and value is not None:
run_options[key] = value
if "parameter_binds" in run_options:
parameter_binds = run_options.pop("parameter_binds")
return self._run_qobj(run_input, validate, parameter_binds, **run_options)
return self._run_qobj(circuits, validate, parameter_binds, **run_options)

only_circuits = True
only_pulse = True
for circ in run_input:
for circ in circuits:
only_circuits &= isinstance(circ, QuantumCircuit)
only_pulse &= isinstance(circ, (ScheduleBlock, Schedule))

Expand All @@ -232,11 +232,11 @@ def run(self, run_input, validate=False, parameter_binds=None, **run_options):
# This path remains for DASK execution to split a qobj insttance
# into sub-qobj instances. This will be replaced with _run_circuits path
# in the near releases
return self._run_qobj(run_input, validate, parameter_binds, **run_options)
return self._run_qobj(circuits, validate, parameter_binds, **run_options)
else:
return self._run_circuits(run_input, parameter_binds, **run_options)
return self._run_circuits(circuits, parameter_binds, **run_options)
elif not only_circuits and only_pulse:
return self._run_qobj(run_input, validate, parameter_binds, **run_options)
return self._run_qobj(circuits, validate, parameter_binds, **run_options)
elif not only_circuits and not only_pulse:
raise TypeError(
"bad input to run() function;"
Expand Down
2 changes: 1 addition & 1 deletion qiskit_aer/primitives/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def _compute(self, circuits, observables, parameter_values, run_options):
if experiments:
results = (
self._backend.run(
circuits=experiments,
experiments,
parameter_binds=parameter_binds if any(parameter_binds) else None,
**run_options,
)
Expand Down

0 comments on commit 5f9acf0

Please sign in to comment.