Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retworkx to generated module list in the .pylintrc #8867

Merged
merged 2 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-allow-list=retworkx, numpy, tweedledum, qiskit._accelerate

extension-pkg-allow-list=retworkx, numpy, tweedledum, qiskit._accelerate, rustworkx
generated-modules=retworkx.visualization,retwork.visit
ignore-modules=retworkx,retworkx.visualization,retworkx.visit

[MESSAGES CONTROL]

Expand Down
2 changes: 1 addition & 1 deletion qiskit/circuit/equivalence.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from collections import namedtuple

from retworkx.visualization import graphviz_draw
from retworkx.visualization import graphviz_draw # pylint: disable=no-name-in-module,import-error
import retworkx as rx

from qiskit.exceptions import InvalidFileError
Expand Down
2 changes: 1 addition & 1 deletion qiskit/transpiler/coupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import numpy as np
import retworkx as rx
from retworkx.visualization import graphviz_draw
from retworkx.visualization import graphviz_draw # pylint: disable=no-name-in-module,import-error

from qiskit.transpiler.exceptions import CouplingError

Expand Down
6 changes: 4 additions & 2 deletions qiskit/transpiler/passes/basis/basis_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

# pylint: disable=missing-function-docstring

"""Translates gates to a target basis using a given equivalence library."""

import time
Expand Down Expand Up @@ -366,7 +368,7 @@ class StopIfBasisRewritable(Exception):
"""Custom exception that signals `retworkx.dijkstra_search` to stop."""


class BasisSearchVisitor(retworkx.visit.DijkstraVisitor):
class BasisSearchVisitor(retworkx.visit.DijkstraVisitor): # pylint: disable=no-member
"""Handles events emitted during `retworkx.dijkstra_search`."""

def __init__(self, graph, source_basis, target_basis, num_gates_for_rule):
Expand Down Expand Up @@ -412,7 +414,7 @@ def examine_edge(self, edge):
# if there are gates in this `rule` that we have not yet generated, we can't apply
# this `rule`. if `target` is already in basis, it's not beneficial to use this rule.
if self._num_gates_remain_for_rule[index] > 0 or target in self.target_basis:
raise retworkx.visit.PruneSearch
raise retworkx.visit.PruneSearch # pylint: disable=no-member

def edge_relaxed(self, edge):
_, target, edata = edge
Expand Down
2 changes: 1 addition & 1 deletion qiskit/visualization/dag_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""
Visualization function for DAG circuit representation.
"""
from retworkx.visualization import graphviz_draw
from retworkx.visualization import graphviz_draw # pylint: disable=no-name-in-module,import-error

from qiskit.dagcircuit.dagnode import DAGOpNode, DAGInNode, DAGOutNode
from qiskit.circuit import Qubit
Expand Down