Skip to content

Return false when chained relations have different lengths - #95

Open
chetana1410 wants to merge 1 commit into
huggingface:mainfrom
chetana1410:fix-chained-relation-length
Open

chetana1410 wants to merge 1 commit into
huggingface:mainfrom
chetana1410:fix-chained-relation-length

Conversation

@chetana1410

Copy link
Copy Markdown

Fixes #93.

verify(..., raise_on_error=True) raised ValueError when both answers were chained relations with a different number of terms. zip(..., strict=True) treated $1<x<3$ against $1<x<3<5$ as a comparison failure instead of a wrong answer.

Different lengths now compare as not equal. A chain still matches the same chain. raise_on_error=False was already returning false for this case, because it swallowed the exception.

pytest tests/test_raise_on_error.py -q
2 passed

A strict zip raised ValueError for 1<x<3 against 1<x<3<5 when raise_on_error was set. Those answers are not equal.

Fixes huggingface#93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

verify() raises ValueError comparing chained relations of different length

1 participant