Repository navigation
Fix sequence emptiness checks in Python scorers - #513
Open
peterolkhov wants to merge 1 commit into
Open
peterolkhov wants to merge 1 commit into
peterolkhov wants to merge 1 commit into
Conversation
Member
|
Can you rebase on the latest develop? The change itself looks good. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Python backend uses sequence truth values to check for empty inputs. That raises
ValueErrorfor multi-element NumPy arrays, and treatsarray([0])as empty:QRatioreturns 0 for two identical inputs instead of 100. The compiled backend handles these inputs correctly.Use sequence length in the six affected guards in Jaro, LCSseq and the fuzzy scorers. Keep the existing missing-value checks and conversion order. No new runtime dependency.
The regression tests cover direct and processor-produced sequences, strided arrays, empty/zero inputs, cutoffs and process helpers across both backends.
Validation on Ubuntu/Python 3.12.12 and Windows/Python 3.12.10 with NumPy 2.2.6:
The hosted run remains failed: the unchanged base has one CPP-suite failure and four Python-suite failures in this environment, and the candidate has the exact same existing outcomes/messages. All 543 original cases were compared by identity. The shared failure is the Prefix cutoff boundary; Python mode also has three process_cpp TypeError expectations that fail on the base. No new existing-case failures were introduced, and none of these failures was waived or reported as passing.
AI-assisted patch with independent source and native-result review.