feat: let's be a bit more flexible with pylint

closes #97
This commit is contained in:
Benoit Chevallier-Mames
2021-08-09 12:20:13 +02:00
committed by Benoit Chevallier
parent 5d9259c000
commit d09f1b90a6
3 changed files with 2 additions and 14 deletions

View File

@@ -33,9 +33,6 @@ def human_readable_layout(graph: nx.Graph, x_delta: float = 1.0, y_delta: float
"""
# FIXME: less variables
# pylint: disable=too-many-locals
nodes_depth = {node: 0 for node in graph.nodes()}
input_nodes = [node for node in graph.nodes() if len(list(graph.predecessors(node))) == 0]
@@ -83,7 +80,6 @@ def human_readable_layout(graph: nx.Graph, x_delta: float = 1.0, y_delta: float
curr_x += x_delta
# pylint: enable=too-many-locals
return pos
@@ -109,9 +105,6 @@ def draw_graph(
"""
# FIXME: less variables
# pylint: disable=too-many-locals
assert isinstance(opgraph, OPGraph)
set_of_nodes_which_are_outputs = set(opgraph.output_nodes.values())
graph = opgraph.graph
@@ -216,8 +209,6 @@ def draw_graph(
# for CI
plt.show(block=block_until_user_closes_graph)
# pylint: enable=too-many-locals
def data_type_to_string(node):
"""Return the datatypes of the outputs of the node

View File

@@ -177,7 +177,6 @@ class ArbitraryFunction(IntermediateNode):
# understand this properly. See https://github.com/python/mypy/issues/708#issuecomment-605636623
arbitrary_func: Optional[Callable]
# pylint: disable=too-many-arguments
def __init__(
self,
input_base_value: BaseValue,
@@ -192,8 +191,6 @@ class ArbitraryFunction(IntermediateNode):
# TLU/PBS has an encrypted output
self.outputs = [EncryptedValue(output_dtype)]
# pylint: enable=too-many-arguments
def evaluate(self, inputs: Mapping[int, Any]) -> Any:
# This is the continuation of the mypy bug workaround
assert self.arbitrary_func is not None

View File

@@ -545,7 +545,7 @@ valid-metaclass-classmethod-first-arg=cls
[DESIGN]
# Maximum number of arguments for function / method.
max-args=5
max-args=10
# Maximum number of attributes for a class (see R0902).
max-attributes=7
@@ -557,7 +557,7 @@ max-bool-expr=5
max-branches=12
# Maximum number of locals for function / method body.
max-locals=15
max-locals=25
# Maximum number of parents for a class (see R0901).
max-parents=7