Repository navigation
Conversation
m-messer
force-pushed
the
fix/criteria-crashes
branch
from
October 20, 2026 14:14
e567f76 to
246f97f
Compare
m-messer
changed the base branch from
refactor/design-patterns
to
refactor/adopt-packages-rc3
October 20, 2026 14:19
m-messer
force-pushed
the
fix/criteria-crashes
branch
from
October 23, 2026 09:43
246f97f to
c07c265
Compare
Base automatically changed from
refactor/adopt-packages-rc3
to
refactor/design-patterns
October 23, 2026 11:50
Base automatically changed from
refactor/design-patterns
to
refactor/restructure-app
October 23, 2026 11:50
Base automatically changed from
refactor/restructure-app
to
refactor/adopt-packages
October 23, 2026 11:51
m-messer
force-pushed
the
fix/criteria-crashes
branch
2 times, most recently
from
October 28, 2026 13:36
ff3e3d8 to
182a579
Compare
m-messer
marked this pull request as ready for review
October 28, 2026 14:26
m-messer
force-pushed
the
fix/criteria-crashes
branch
2 times, most recently
from
October 28, 2026 17:48
4853746 to
f101177
Compare
…n, and handle edge cases for non-constant values; add targeted test coverage for criteria mismatches and tolerance checks.
…on_infinite` to evaluate only requested comparisons
…nd update `comparison_function` to return `None` for unresolved symbolic differences
…ass, simplify `parse_criterion_sides`, update match functions, and expand test coverage.
…he rc4 rename Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
m-messer
force-pushed
the
fix/criteria-crashes
branch
from
October 28, 2026 21:12
f101177 to
914a48a
Compare
16 tasks
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.
Problem
Some criteria gave learners an error instead of feedback. These bugs came up during the context refactor (bug report). This is the first PR of the bug-fix stack, and it is stacked on #283.
matchescriteria whose sides weren't exactlyresponse/answercrashed or applied the tolerance to the wrong values. Sets andNonestandard values also crashed_within_tolerance.1/0) sometimes crashed. Every comparison operator was evaluated, not only the one requested, so whether it crashed depended on hash randomisation.response > 1.5 mraisedTypeError(14a). A quantity written out in the criterion was not parsed with units (14b).response matches 2 mwas always false. 14b fixes this.'Rational' * 'NoneType'). 14b fixes this.Changes
_within_tolerance(app/context/physical_quantity/graphs/match.py): returnsFalseunless a tolerance is set, the criterion is response/answer, and both standard values are single sympy expressions.do_comparison_infinite(app/context/symbolic/comparison.py): looks up only the requested operator inCOMPARISON_OPERATORSand evaluates it inside thetry.comparison_function(app/context/physical_quantity/comparison.py): returnsNone(unknown) when sympy cannot decide the truth value, instead of raisingTypeError.CriterionSides(app/context/physical_quantity/comparison.py):parse_criterion_sidesnow returns a frozen dataclass. A side written out as a quantity (INPUTlabel) is parsed with the quantity parser and stands in the expression as acriterion_lhs/criterion_rhssymbol. ItsParsedQuantitygoes intosides.quantitiesnext to the response and answer.match.py(_quantity_match,_dimension_match,_unit_comparison) andorder.py(comparison_base_graph) substitute fromsides.quantities.order.pycompares a quantity without a unit by its value alone.parsed_quantityis split out ofparse_quantityinapp/context/physical_quantity/parsing.py.Checklist
Testing
test_matches_criteria_other_than_response_and_answer_when_values_differ,test_order_criteria_against_written_out_quantityandtest_matches_criteria_against_written_out_quantityinphysical_quantity_evaluation_test.py.test_complex_infinityandtest_do_comparison_infinite_only_evaluates_requested_comparisoninsymbolic_evaluation_test.py. The direct test is there because the end-to-end crash only happened on some runs.pytest app: 1241 passed, 2 skipped, 1 failed. The failure istest_radians_to_frequency, which already failed before this PR.mypy app: no issues.Still open in the bug report, for the next PRs in the stack: 2, 3, 4, 6, 7, 8, 9, 11, 13, 15, and the feedback strings.
This is the bottom of the stack and merges into
main. These lines close issues fixed higher up the stack:🤖 Generated with Claude Code