From 86052fa43d5de82fe9bc7ce01cd6b79777f3a026 Mon Sep 17 00:00:00 2001 From: Arthur Meyre Date: Thu, 23 Sep 2021 10:50:35 +0200 Subject: [PATCH] chore(tools): update command line for isort to follow the 100 line length --- concrete/common/mlir/mlir_converter.py | 9 +-------- concrete/numpy/__init__.py | 9 +-------- script/source_format/format_python.sh | 2 +- tests/common/bounds_measurement/test_inputset_eval.py | 4 +--- tests/common/debugging/test_custom_assert.py | 6 +----- tests/common/representation/test_intermediate.py | 7 +------ tests/numpy/test_compile.py | 5 +---- tests/numpy/test_tracing.py | 7 +------ 8 files changed, 8 insertions(+), 41 deletions(-) diff --git a/concrete/common/mlir/mlir_converter.py b/concrete/common/mlir/mlir_converter.py index 2aa328ac3..7273268a3 100644 --- a/concrete/common/mlir/mlir_converter.py +++ b/concrete/common/mlir/mlir_converter.py @@ -5,14 +5,7 @@ from typing import Tuple, cast import networkx as nx import zamalang from mlir.dialects import builtin -from mlir.ir import ( - Context, - InsertionPoint, - IntegerType, - Location, - Module, - RankedTensorType, -) +from mlir.ir import Context, InsertionPoint, IntegerType, Location, Module, RankedTensorType from mlir.ir import Type as MLIRType from mlir.ir import UnrankedTensorType from zamalang.dialects import hlfhe diff --git a/concrete/numpy/__init__.py b/concrete/numpy/__init__.py index 97cfc0789..7e793806f 100644 --- a/concrete/numpy/__init__.py +++ b/concrete/numpy/__init__.py @@ -1,14 +1,7 @@ """Module for compiling numpy functions to homomorphic equivalents.""" from ..common.compilation import CompilationArtifacts, CompilationConfiguration -from ..common.data_types import ( - Float, - Float32, - Float64, - Integer, - SignedInteger, - UnsignedInteger, -) +from ..common.data_types import Float, Float32, Float64, Integer, SignedInteger, UnsignedInteger from ..common.debugging import draw_graph, get_printable_graph from ..common.extensions.table import LookupTable from ..common.values import ( diff --git a/script/source_format/format_python.sh b/script/source_format/format_python.sh index d136b935c..73be71883 100755 --- a/script/source_format/format_python.sh +++ b/script/source_format/format_python.sh @@ -37,7 +37,7 @@ do done for SRC_DIR in "${DIRS[@]}"; do - isort --profile black ${CHECK:+"$CHECK"} "${SRC_DIR}" + isort -l 100 --profile black ${CHECK:+"$CHECK"} "${SRC_DIR}" ((FAILURES+=$?)) black -l 100 ${CHECK:+"$CHECK"} "${SRC_DIR}" ((FAILURES+=$?)) diff --git a/tests/common/bounds_measurement/test_inputset_eval.py b/tests/common/bounds_measurement/test_inputset_eval.py index d2b07f30a..3569c8bc5 100644 --- a/tests/common/bounds_measurement/test_inputset_eval.py +++ b/tests/common/bounds_measurement/test_inputset_eval.py @@ -4,9 +4,7 @@ from typing import Tuple import pytest -from concrete.common.bounds_measurement.inputset_eval import ( - eval_op_graph_bounds_on_inputset, -) +from concrete.common.bounds_measurement.inputset_eval import eval_op_graph_bounds_on_inputset from concrete.common.data_types.floats import Float from concrete.common.data_types.integers import Integer from concrete.common.values import EncryptedScalar diff --git a/tests/common/debugging/test_custom_assert.py b/tests/common/debugging/test_custom_assert.py index aa34b7a85..b779f4bce 100644 --- a/tests/common/debugging/test_custom_assert.py +++ b/tests/common/debugging/test_custom_assert.py @@ -1,11 +1,7 @@ """Test custom assert functions.""" import pytest -from concrete.common.debugging.custom_assert import ( - assert_false, - assert_not_reached, - assert_true, -) +from concrete.common.debugging.custom_assert import assert_false, assert_not_reached, assert_true def test_assert_not_functions(): diff --git a/tests/common/representation/test_intermediate.py b/tests/common/representation/test_intermediate.py index b99668bac..34251437e 100644 --- a/tests/common/representation/test_intermediate.py +++ b/tests/common/representation/test_intermediate.py @@ -6,12 +6,7 @@ import pytest from concrete.common.data_types.floats import Float from concrete.common.data_types.integers import Integer from concrete.common.representation import intermediate as ir -from concrete.common.values import ( - ClearScalar, - ClearTensor, - EncryptedScalar, - EncryptedTensor, -) +from concrete.common.values import ClearScalar, ClearTensor, EncryptedScalar, EncryptedTensor @pytest.mark.parametrize( diff --git a/tests/numpy/test_compile.py b/tests/numpy/test_compile.py index be4e47432..3aacdb737 100644 --- a/tests/numpy/test_compile.py +++ b/tests/numpy/test_compile.py @@ -10,10 +10,7 @@ from concrete.common.data_types.integers import Integer from concrete.common.debugging import draw_graph, get_printable_graph from concrete.common.extensions.table import LookupTable from concrete.common.values import ClearTensor, EncryptedScalar, EncryptedTensor -from concrete.numpy.compile import ( - compile_numpy_function, - compile_numpy_function_into_op_graph, -) +from concrete.numpy.compile import compile_numpy_function, compile_numpy_function_into_op_graph def no_fuse_unhandled(x, y): diff --git a/tests/numpy/test_tracing.py b/tests/numpy/test_tracing.py index 1df0e01d0..76634a779 100644 --- a/tests/numpy/test_tracing.py +++ b/tests/numpy/test_tracing.py @@ -7,12 +7,7 @@ import pytest from concrete.common.data_types.floats import Float from concrete.common.data_types.integers import Integer from concrete.common.representation import intermediate as ir -from concrete.common.values import ( - ClearScalar, - ClearTensor, - EncryptedScalar, - EncryptedTensor, -) +from concrete.common.values import ClearScalar, ClearTensor, EncryptedScalar, EncryptedTensor from concrete.numpy import tracing OPERATIONS_TO_TEST = [ir.Add, ir.Sub, ir.Mul]