Skip to content

Commit 3220785

Browse files
authored
Remove useless pylint suppressions (#8292)
**Context:** **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:**
1 parent 7ee8274 commit 3220785

File tree

129 files changed

+146
-249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+146
-249
lines changed

pennylane/allocation.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class AllocateState(StrEnum):
4747
allocate_prim = QmlPrimitive("allocate")
4848
allocate_prim.multiple_results = True
4949

50-
# pylint: disable=unused-argument
5150
@allocate_prim.def_impl
5251
def _(*, num_wires, state: AllocateState = AllocateState.ZERO, restored=False):
5352
raise NotImplementedError("jaxpr containing qubit allocation cannot be executed.")
@@ -60,7 +59,6 @@ def _(*, num_wires, state: AllocateState = AllocateState.ZERO, restored=False):
6059
deallocate_prim = QmlPrimitive("deallocate")
6160
deallocate_prim.multiple_results = True
6261

63-
# pylint: disable=unused-argument
6462
@deallocate_prim.def_impl
6563
def _(*wires):
6664
raise NotImplementedError("jaxpr containing qubit deallocation cannot be executed.")
@@ -171,7 +169,6 @@ def c():
171169
return Deallocate(wires)
172170

173171

174-
# pylint: disable=too-many-ancestors
175172
class DynamicRegister(Wires):
176173
"""A specialized ``Wires`` class for dynamic wires with a context manager for automatic deallocation."""
177174

pennylane/bose/bosonic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ def shift_operator(self, initial_position, final_position):
413413
return bs
414414

415415

416-
# pylint: disable=useless-super-delegation
417416
class BoseSentence(dict):
418417
r"""Dictionary used to represent a Bose sentence, a linear combination of Bose words,
419418
with the keys as BoseWord instances and the values correspond to coefficients.

pennylane/capture/autograph/operator_update.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
# limitations under the License.
1414
"""Converter for array element operator assignment."""
1515

16-
# pylint: disable=no-member, too-few-public-methods
16+
# pylint: disable=no-member
1717

1818
import gast
1919
from malt.core import converter
2020
from malt.pyct import templates
2121

2222

23+
# pylint: disable=too-few-public-methods
2324
# TODO: The methods from this class should be moved to the SliceTransformer class in DiastaticMalt
2425
class SingleIndexArrayOperatorUpdateTransformer(converter.Base):
2526
"""Converts array element operator assignment statements into calls to update_item_with_{op},

pennylane/capture/base_interpreter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"""
1515
This submodule defines a strategy structure for defining custom plxpr interpreters
1616
"""
17+
# pylint: disable=no-self-use
18+
1719
from collections.abc import Callable, Sequence
1820
from copy import copy
1921
from functools import partial, wraps
20-
21-
# pylint: disable=no-self-use, wrong-import-position
2222
from importlib.metadata import version
2323

2424
import jax
@@ -645,7 +645,6 @@ class FlattenedInterpreter(PlxprInterpreter):
645645
from jax._src.pjit import pjit_p
646646

647647

648-
# pylint: disable=protected-access
649648
@FlattenedInterpreter.register_primitive(pjit_p)
650649
def _(self, *invals, jaxpr, **params):
651650
if jax.config.jax_dynamic_shapes:

pennylane/capture/custom_primitives.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class PrimitiveType(Enum):
3030
TRANSFORM = "transform"
3131

3232

33-
# pylint: disable=too-few-public-methods
33+
# pylint: disable=abstract-method,too-few-public-methods
3434
class QmlPrimitive(Primitive):
3535
"""A subclass for JAX's Primitive that differentiates between different
3636
classes of primitives."""

pennylane/compiler/python_compiler/dialects/quantum.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ class GlobalPhaseOp(IRDLOperation):
511511

512512
out_ctrl_qubits = var_result_def(QubitType)
513513

514-
# pylint: disable=too-many-arguments
515514
def __init__(
516515
self,
517516
*,

pennylane/compiler/python_compiler/dialects/stablehlo/data_movement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def verify_(self) -> None:
9292
assert isinstance(o_type, TensorType) and isinstance(r_type, TensorType)
9393

9494
# broadcast_in_dim_c2: broadcast_dimensions size == operand rank
95-
dims = tuple(self.broadcast_dimensions.get_values()) # pylint: disable=no-member
95+
dims = tuple(self.broadcast_dimensions.get_values())
9696
operand_rank = o_type.get_num_dims()
9797
if len(dims) != operand_rank:
9898
raise VerifyException(

pennylane/compiler/python_compiler/dialects/stablehlo/types.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
NestedTupleOfConstraint,
4949
)
5050

51-
# pylint: disable=fixme
52-
5351

5452
def _create_param_constrained_type(
5553
base_attr: type, widths: list[int], signedness: Signedness | None = None

pennylane/compiler/python_compiler/dialects/transform.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
from xdsl.dialects.builtin import Dialect
4343

44-
# pylint: disable=unused-wildcard-import,wildcard-import,undefined-variable,too-few-public-methods
44+
# pylint: disable=too-few-public-methods
4545
from xdsl.dialects.transform import ApplyRegisteredPassOp as xApplyRegisteredPassOp
4646
from xdsl.dialects.transform import (
4747
DictionaryAttr,
@@ -60,7 +60,6 @@
6060

6161

6262
@irdl_op_definition
63-
# pylint: disable=function-redefined
6463
class ApplyRegisteredPassOp(IRDLOperation):
6564
"""
6665
See external [documentation](https://mlir.llvm.org/docs/Dialects/Transform/#transformapply_registered_pass-transformapplyregisteredpassop).

pennylane/compiler/python_compiler/jax_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from catalyst import QJIT
2222
from jax._src.lib import _jax
23-
from jaxlib.mlir.dialects import stablehlo as jstablehlo # pylint: disable=no-name-in-module
23+
from jaxlib.mlir.dialects import stablehlo as jstablehlo
2424
from jaxlib.mlir.ir import Context as jContext # pylint: disable=no-name-in-module
2525
from jaxlib.mlir.ir import Module as jModule # pylint: disable=no-name-in-module
2626
from xdsl.context import Context as xContext
@@ -38,7 +38,7 @@
3838
JaxJittedFunction: TypeAlias = _jax.PjitFunction # pylint: disable=c-extension-no-member
3939

4040

41-
class QuantumParser(xParser): # pylint: disable=abstract-method,too-few-public-methods
41+
class QuantumParser(xParser): # pylint: disable=too-few-public-methods
4242
"""A subclass of ``xdsl.parser.Parser`` that automatically loads relevant dialects
4343
into the input context.
4444

0 commit comments

Comments
 (0)