From d09f1b90a6e0a53f38d143ca82c4488dcb21ff50 Mon Sep 17 00:00:00 2001 From: Benoit Chevallier-Mames Date: Mon, 9 Aug 2021 12:20:13 +0200 Subject: [PATCH] feat: let's be a bit more flexible with pylint closes #97 --- hdk/common/debugging/draw_graph.py | 9 --------- hdk/common/representation/intermediate.py | 3 --- pylintrc | 4 ++-- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/hdk/common/debugging/draw_graph.py b/hdk/common/debugging/draw_graph.py index ec6a8038c..33cf49bd7 100644 --- a/hdk/common/debugging/draw_graph.py +++ b/hdk/common/debugging/draw_graph.py @@ -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 diff --git a/hdk/common/representation/intermediate.py b/hdk/common/representation/intermediate.py index 4b07e042d..11fdf1a3d 100644 --- a/hdk/common/representation/intermediate.py +++ b/hdk/common/representation/intermediate.py @@ -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 diff --git a/pylintrc b/pylintrc index 388215226..d835e1277 100644 --- a/pylintrc +++ b/pylintrc @@ -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