From c142be481dbba61acca769597e75aed0d671fc8e Mon Sep 17 00:00:00 2001 From: Raoul Schram Date: Mon, 9 Sep 2024 14:20:15 +0200 Subject: [PATCH 1/2] Make pylint happy --- regexmodel/regexclass.py | 1 + 1 file changed, 1 insertion(+) diff --git a/regexmodel/regexclass.py b/regexmodel/regexclass.py index e326dc9..f3c131f 100644 --- a/regexmodel/regexclass.py +++ b/regexmodel/regexclass.py @@ -260,6 +260,7 @@ def get_candidates(cls, series: pl.Series, else: score_sub = 0 regex = cls() + next_series_sub = next_series_full if score_full >= score_sub: if score_full > 0: From e44ee3d32275d67e657e69ffcc258ec6602bb855 Mon Sep 17 00:00:00 2001 From: Raoul Schram Date: Mon, 9 Sep 2024 14:30:10 +0200 Subject: [PATCH 2/2] Ignore mypy error --- regexmodel/regexclass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regexmodel/regexclass.py b/regexmodel/regexclass.py index f3c131f..62134f0 100644 --- a/regexmodel/regexclass.py +++ b/regexmodel/regexclass.py @@ -325,7 +325,7 @@ def score(series: pl.Series, regex: BaseRegex, count_thres: int, fraction_match = next_not_null/cur_not_null fraction_cover = n_unique/regex.n_possible - expected_finish = fraction_match**avg_len_next*next_not_null + expected_finish = fraction_match**avg_len_next*next_not_null # type: ignore expected_finish = max(1e-12, expected_finish) split_penalty = 1/(1 + count_thres/expected_finish) cur_score = regex.subrange_penalty*split_penalty*fraction_cover*fraction_match