Skip to content

Commit

Permalink
fix(frontend-python): fhe.function use staticmethod, disable linter f…
Browse files Browse the repository at this point in the history
…or levenshtein example
  • Loading branch information
rudy-6-4 committed Jul 29, 2024
1 parent cabe4e8 commit 0379f9a
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0379f9a

Please sign in to comment.