mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
chore: disable pylint line too long in test_compile where necessary
- fix pylint targets for non package dirs
This commit is contained in:
8
Makefile
8
Makefile
@@ -42,17 +42,17 @@ pylint_src:
|
||||
|
||||
pylint_tests:
|
||||
@# Disable duplicate code detection in tests
|
||||
poetry run pylint --disable=R0801 --rcfile=pylintrc tests
|
||||
find ./tests/ -type f -name "*.py" | xargs poetry run pylint --disable=R0801 --rcfile=pylintrc
|
||||
.PHONY: pylint_tests
|
||||
|
||||
pylint_benchmarks:
|
||||
@# Disable duplicate code detection, docstring requirement, too many locals/statements
|
||||
poetry run pylint --disable=R0801,R0914,R0915,C0103,C0114,C0115,C0116 \
|
||||
--rcfile=pylintrc benchmarks
|
||||
find ./benchmarks/ -type f -name "*.py" | xargs poetry run pylint \
|
||||
--disable=R0801,R0914,R0915,C0103,C0114,C0115,C0116 --rcfile=pylintrc
|
||||
.PHONY: pylint_benchmarks
|
||||
|
||||
pylint_script:
|
||||
poetry run pylint --rcfile=pylintrc script
|
||||
find ./script/ -type f -name "*.py" | xargs poetry run pylint --rcfile=pylintrc
|
||||
.PHONY: pylint_script
|
||||
|
||||
flake8:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
"""Test module."""
|
||||
@@ -283,10 +283,9 @@ def subtest_fuse_float_unary_operations_correctness(fun, tensor_shape):
|
||||
# Create inputs which are either of the form [x, x] or [x, y]
|
||||
for j in range(4):
|
||||
|
||||
if fun in [numpy.arctanh, numpy.arccos, numpy.arcsin, numpy.arctan]:
|
||||
if j > 0:
|
||||
# Domain of definition for these functions
|
||||
break
|
||||
if fun in [numpy.arctanh, numpy.arccos, numpy.arcsin, numpy.arctan] and j > 0:
|
||||
# Domain of definition for these functions
|
||||
break
|
||||
|
||||
input_a = input_
|
||||
input_b = input_ + j
|
||||
@@ -295,10 +294,7 @@ def subtest_fuse_float_unary_operations_correctness(fun, tensor_shape):
|
||||
numpy.random.shuffle(input_a)
|
||||
numpy.random.shuffle(input_b)
|
||||
|
||||
if random.randint(0, 1) == 0:
|
||||
inputs = (input_a, input_b)
|
||||
else:
|
||||
inputs = (input_b, input_a)
|
||||
inputs = (input_a, input_b) if random.randint(0, 1) == 0 else (input_b, input_a)
|
||||
|
||||
function_result = function_to_trace(*inputs)
|
||||
op_graph_result = op_graph(*inputs)
|
||||
|
||||
@@ -716,10 +716,10 @@ def test_compile_function_with_direct_tlu_overflow():
|
||||
(
|
||||
"function you are trying to compile isn't supported for MLIR lowering\n"
|
||||
"\n"
|
||||
"%0 = Constant(1) # ClearScalar<Integer<unsigned, 1 bits>>\n" # noqa: E501
|
||||
"%1 = x # EncryptedScalar<Integer<unsigned, 3 bits>>\n" # noqa: E501
|
||||
"%2 = Sub(%0, %1) # EncryptedScalar<Integer<signed, 4 bits>>\n" # noqa: E501
|
||||
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ signed integer outputs aren't supported\n" # noqa: E501
|
||||
"%0 = Constant(1) # ClearScalar<Integer<unsigned, 1 bits>>\n" # noqa: E501 # pylint: disable=line-too-long
|
||||
"%1 = x # EncryptedScalar<Integer<unsigned, 3 bits>>\n" # noqa: E501 # pylint: disable=line-too-long
|
||||
"%2 = Sub(%0, %1) # EncryptedScalar<Integer<signed, 4 bits>>\n" # noqa: E501 # pylint: disable=line-too-long
|
||||
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ signed integer outputs aren't supported\n" # noqa: E501 # pylint: disable=line-too-long
|
||||
"return(%2)\n"
|
||||
),
|
||||
),
|
||||
@@ -730,10 +730,10 @@ def test_compile_function_with_direct_tlu_overflow():
|
||||
(
|
||||
"function you are trying to compile isn't supported for MLIR lowering\n"
|
||||
"\n"
|
||||
"%0 = x # EncryptedTensor<Integer<unsigned, 3 bits>, shape=(2, 2)>\n" # noqa: E501
|
||||
"%1 = Constant(1) # ClearScalar<Integer<unsigned, 1 bits>>\n" # noqa: E501
|
||||
"%2 = Add(%0, %1) # EncryptedTensor<Integer<unsigned, 4 bits>, shape=(2, 2)>\n" # noqa: E501
|
||||
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ non scalar outputs aren't supported\n" # noqa: E501
|
||||
"%0 = x # EncryptedTensor<Integer<unsigned, 3 bits>, shape=(2, 2)>\n" # noqa: E501 # pylint: disable=line-too-long
|
||||
"%1 = Constant(1) # ClearScalar<Integer<unsigned, 1 bits>>\n" # noqa: E501 # pylint: disable=line-too-long
|
||||
"%2 = Add(%0, %1) # EncryptedTensor<Integer<unsigned, 4 bits>, shape=(2, 2)>\n" # noqa: E501 # pylint: disable=line-too-long
|
||||
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ non scalar outputs aren't supported\n" # noqa: E501 # pylint: disable=line-too-long
|
||||
"return(%2)\n"
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user