Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pylint happy #12

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion regexmodel/regexclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -324,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
Expand Down
Loading