Skip to content

Commit 6371600

Browse files
maffootonybruguier
authored andcommitted
Update to pylint 2.13 (quantumlib#5156)
Review: @mpharrigan
1 parent 2ba3491 commit 6371600

26 files changed

Lines changed: 51 additions & 44 deletions

cirq-core/cirq/circuits/circuit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ def zip(
13591359
same moment index.
13601360
13611361
Args:
1362-
circuits: The circuits to merge together.
1362+
*circuits: The circuits to merge together.
13631363
align: The alignment for the zip, see `cirq.Alignment`.
13641364
13651365
Returns:
@@ -1441,7 +1441,7 @@ def tetris_concat(
14411441
False
14421442
14431443
Args:
1444-
circuits: The circuits to concatenate.
1444+
*circuits: The circuits to concatenate.
14451445
align: When to stop when sliding the circuits together.
14461446
'left': Stop when the starts of the circuits align.
14471447
'right': Stop when the ends of the circuits align.

cirq-core/cirq/circuits/circuit_operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def with_qubits(self, *new_qubits: 'cirq.Qid') -> 'cirq.CircuitOperation':
616616
"""Returns a copy of this operation with an updated qubit mapping.
617617
618618
Args:
619-
new_qubits: A list of qubits to target. Qubits in this list are
619+
*new_qubits: A list of qubits to target. Qubits in this list are
620620
matched to qubits in the circuit following default qubit order,
621621
ignoring any existing qubit map.
622622

cirq-core/cirq/circuits/moment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def with_operations(self, *contents: 'cirq.OP_TREE') -> 'cirq.Moment':
177177
"""Returns a new moment with the given contents added.
178178
179179
Args:
180-
contents: New operations to add to this moment.
180+
*contents: New operations to add to this moment.
181181
182182
Returns:
183183
The new moment.

cirq-core/cirq/devices/named_topologies.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def draw_gridlike(
7575
ax: Optional matplotlib axis to use for drawing.
7676
tilted: If True, directly position as (row, column); otherwise,
7777
rotate 45 degrees to accommodate google-style diagonal grids.
78-
kwargs: Additional arguments to pass to `nx.draw_networkx`.
78+
**kwargs: Additional arguments to pass to `nx.draw_networkx`.
7979
8080
Returns:
8181
A positions dictionary mapping nodes to (x, y) coordinates suitable for future calls
@@ -126,7 +126,7 @@ def draw(self, ax=None, tilted: bool = True, **kwargs) -> Dict[Any, Tuple[int, i
126126
Args:
127127
ax: Optional matplotlib axis to use for drawing.
128128
tilted: If True, draw as a horizontal line. Otherwise, draw on a diagonal.
129-
kwargs: Additional arguments to pass to `nx.draw_networkx`.
129+
**kwargs: Additional arguments to pass to `nx.draw_networkx`.
130130
"""
131131
g2 = nx.relabel_nodes(self.graph, {n: (n, 1) for n in self.graph.nodes})
132132
return draw_gridlike(g2, ax=ax, tilted=tilted, **kwargs)
@@ -217,7 +217,7 @@ def draw(self, ax=None, tilted=True, **kwargs):
217217
ax: Optional matplotlib axis to use for drawing.
218218
tilted: If True, directly position as (row, column); otherwise,
219219
rotate 45 degrees to accommodate the diagonal nature of this topology.
220-
kwargs: Additional arguments to pass to `nx.draw_networkx`.
220+
**kwargs: Additional arguments to pass to `nx.draw_networkx`.
221221
"""
222222
return draw_gridlike(self.graph, ax=ax, tilted=tilted, **kwargs)
223223

cirq-core/cirq/experiments/qubit_characterizations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def plot(self, axes: Optional[List[plt.Axes]] = None, **plot_kwargs: Any) -> Lis
171171
axes: A list of 2 `plt.Axes` instances. Note that they must be in
172172
3d projections. If not given, a new figure is created with 2
173173
axes and the plotted figure is shown.
174-
plot_kwargs: The optional kwargs passed to bar3d.
174+
**plot_kwargs: The optional kwargs passed to bar3d.
175175
176176
Returns:
177177
the list of `plt.Axes` being plotted on.

cirq-core/cirq/linalg/decompositions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def scatter_plot_normalized_kak_interaction_coefficients(
592592
wireframe. Defaults to `True`.
593593
ax: A matplotlib 3d axes object to plot into. If not specified, a new
594594
figure is created, plotted, and shown.
595-
kwargs: Arguments forwarded into the call to `scatter` that plots the
595+
**kwargs: Arguments forwarded into the call to `scatter` that plots the
596596
points. Working arguments include color `c='blue'`, scale `s=2`,
597597
labelling `label="theta=pi/4"`, etc. For reference see the
598598
`matplotlib.pyplot.scatter` documentation:

cirq-core/cirq/ops/arithmetic_operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def with_registers(self: TSelf, *new_registers: Union[int, Sequence['cirq.Qid']]
107107
"""Returns the same operation targeting different registers.
108108
109109
Args:
110-
new_registers: The new values that should be returned by the
110+
*new_registers: The new values that should be returned by the
111111
`registers` method.
112112
113113
Returns:

cirq-core/cirq/ops/fourier_transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def qft(
198198
equivalently `cirq.inverse(cirq.qft(*qubits))`.
199199
200200
Args:
201-
qubits: The qubits to apply the qft to.
201+
*qubits: The qubits to apply the qft to.
202202
without_reverse: When set, swap gates at the end of the qft are omitted.
203203
This reverses the qubit order relative to the standard qft effect,
204204
but makes the gate cheaper to apply.

cirq-core/cirq/ops/pauli_string_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ def test_pauli_string_expectation_from_density_matrix_pure_state_with_coef():
13111311
z0z2 = cirq.Z(qs[0]) * cirq.Z(qs[2]) * -1
13121312
z1x2 = -cirq.Z(qs[1]) * cirq.X(qs[2])
13131313

1314-
for state in [rho, rho.reshape(2, 2, 2, 2, 2, 2, 2, 2)]:
1314+
for state in [rho, rho.reshape((2, 2, 2, 2, 2, 2, 2, 2))]:
13151315
np.testing.assert_allclose(z0z1.expectation_from_density_matrix(state, q_map), -0.123)
13161316
np.testing.assert_allclose(z0z2.expectation_from_density_matrix(state, q_map), 0)
13171317
np.testing.assert_allclose(z1x2.expectation_from_density_matrix(state, q_map), 1)

cirq-core/cirq/ops/raw_types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def with_qubits(self: TSelf, *new_qubits: 'cirq.Qid') -> TSelf:
458458
"""Returns the same operation, but applied to different qubits.
459459
460460
Args:
461-
new_qubits: The new qubits to apply the operation to. The order must
461+
*new_qubits: The new qubits to apply the operation to. The order must
462462
exactly match the order of qubits returned from the operation's
463463
`qubits` property.
464464
"""
@@ -489,7 +489,7 @@ def with_tags(self, *new_tags: Hashable) -> 'cirq.Operation':
489489
also restrict the operation to be JSON serializable.
490490
491491
Args:
492-
new_tags: The tags to wrap this operation in.
492+
*new_tags: The tags to wrap this operation in.
493493
"""
494494
if not new_tags:
495495
return self
@@ -529,7 +529,7 @@ def controlled_by(
529529
are specified, returns self.
530530
531531
Args:
532-
control_qubits: Qubits to control the operation by. Required.
532+
*control_qubits: Qubits to control the operation by. Required.
533533
control_values: For which control qubit values to apply the
534534
operation. A sequence of the same length as `control_qubits`
535535
where each entry is an integer (or set of integers)
@@ -627,7 +627,7 @@ def with_classical_controls(
627627
since tags are considered a local attribute.
628628
629629
Args:
630-
conditions: A list of measurement keys, strings that can be parsed
630+
*conditions: A list of measurement keys, strings that can be parsed
631631
into measurement keys, or sympy expressions where the free
632632
symbols are measurement key strings.
633633

0 commit comments

Comments
 (0)