Repository navigation
Conversation
…YS_FUNCTIONS`, update substitutions logic and tests
…e parsing logic and tests
…yntaxError` for unmatched brackets, update parsing logic and tests
…ation` with `Sum`, update tests and changelog
…s unevaluated, refine handling of infinite limits in sums, update parsing logic, tests, and changelog
…fine evaluation checks for large expressions, update parsing logic, tests, and changelog
…simplify `parsing_action` and `_reduce` logic, add test, update changelog
…aid rendering, and add test for shape handling
…urn sorted tuple instead of list
…pendencies accordingly
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.
Fixes from a review of
mainsincev0.3.0-rc.2, then bumps all four packages to0.3.0rc3. One commit per fix.expression_parsing
summationnames the task's symbol again where it isn't applied: withSaliased tosummation,2*summationis2*S(it raised "summation is a function"). Applied,summation(...)is still the sum.integrate,summation,productandlimitare unevaluated withoutsimplify(Integral,Sum,Product,Limit), like other functions. They are plain functions, so unevaluated parsing didn't reach them:product(k!, (k, 1, 3000))andsum(k!, (k, 1, 3000))took seconds and then failed.simplify, SymPy works out products and limits and leaves integrals and finite sums unevaluated.check_evaluation_costnow bounds aProductwith numeric limits: at mostMAX_PRODUCT_TERMS(1000, exported) factors, with the index as large as its bound (product(k, (k, 1, 500))is rejected likefactorial(500)).oo,pi**2/6): SymPy can't approximate a divergent series numerically, and compareExpressions compares by value.criteria
split_criteriaraisesCriteriaSyntaxErrorfor an empty criterion (a = b,,a,,b,""), instead of returning""for the criteria parser to fail on.split_criteriatreats all brackets as one kind, so half-open intervals split correctly:response in [0, 1), response > 0is two criteria (it raised). A closing bracket with none open, or a bracket left open, still raises.STYLE;graph_to_mermaidreads them liketree.pydoes. The output is unchanged.slr_parsing
GrammarErrorrather than a bareKeyError. Only an error action that rewrites the stack can cause one._reduceandparsing_actiongo throughParseTable.goto/entry; parsing is about 4% slower on a criteria benchmark.units
unsplittable_namesis cached per unit set (a small gain: about 1.6% ofparse_quantity).Version
0.3.0rc3in everypyproject.toml, ranges between the packages>=0.3.0rc3,<0.4.0, README install tagsv0.3.0-rc.3, CHANGELOG headings,poetry.lock.Downstream (compareExpressions)
test_radians_to_frequency, which also fails onmain(units: make the angle a dimension, so 1 Hz is 2π rad/s #1 addresses it).simplify. Its comparisons simplify the difference, which works them out, so equal answers still compare equal..simplify()there works out expensive expressions.Verification
scripts/release_version.py v0.3.0-rc.3 --prereleasepasses.Not in this PR
elementary_functions,integrate(...)is rewritten toint E grat Eand fails to parse. This existed before this branch; it needs its own fix.After merging, tag
v0.3.0-rc.3onmainto run the pre-release workflow.🤖 Generated with Claude Code