From 0379f9a65687d272558a881db3ebfe7e377d3718 Mon Sep 17 00:00:00 2001 From: rudy Date: Tue, 23 Jul 2024 19:39:13 +0200 Subject: [PATCH] fix(frontend-python): fhe.function use staticmethod, disable linter for levenshtein example --- .../examples/levenshtein_distance/levenshtein_distance.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontends/concrete-python/examples/levenshtein_distance/levenshtein_distance.py b/frontends/concrete-python/examples/levenshtein_distance/levenshtein_distance.py index 04382dd3d1..b3e3e8787e 100644 --- a/frontends/concrete-python/examples/levenshtein_distance/levenshtein_distance.py +++ b/frontends/concrete-python/examples/levenshtein_distance/levenshtein_distance.py @@ -1,6 +1,7 @@ # Computing Levenstein distance between strings, https://en.wikipedia.org/wiki/Levenshtein_distance -# ruff: noqa:S311 +# ruff: noqa:S311,N805 +# pylint: disable=no-self-argument import argparse import random @@ -223,18 +224,15 @@ def _compute_in_fhe(self, list_patterns: list, show_distance: bool = False): # Module FHE @fhe.module() class LevenshsteinModule: - @staticmethod @fhe.function({"x": "encrypted", "y": "encrypted"}) def equal(x, y): """Assert equality between two chars of the alphabet.""" return x == y - @staticmethod @fhe.function({"x": "clear"}) def constant(x): return fhe.zero() + x - @staticmethod @fhe.function( { "is_equal": "encrypted",