Skip to content

expression-parsing: big-operator task symbols wrap their argument - #11

Draft
m-messer wants to merge 1 commit into
mainfrom
feat/big-operator-symbols
Draft

m-messer wants to merge 1 commit into
mainfrom
feat/big-operator-symbols

Conversation

@m-messer

Copy link
Copy Markdown
Member

Ports the parsing half of compareExpressions#261 (big-operator custom symbols) to expression_parsing. The preview test stays in compareExpressions.

expression_parsing

  • A task symbol whose LaTeX starts with a big operator (\sum, \int, \prod, \lim, \bigcup, \bigcap; BIG_OPERATOR_PREFIXES) wraps its argument when applied. With infsum as \sum_{n=1}^{\infty}, infsum((-1)^n/n^2) is an undefined function of the summand, and sympy_to_latex prints the operator followed by it. Before, it was the product infsum*(...), so the operator was printed inside the fraction or followed by \cdot.
  • When it isn't applied (2*infsum), it is still the task's symbol.
  • The function is an UndefinedFunction with a module-level _latex hook, so a config that uses one can still be pickled. #261 built a class around a closure, which can't be pickled.

Verification

  • ruff, format and mypy are clean. The package tests pass, and so does the parity check (0 unexpected, 0 mismatched).

🤖 Generated with Claude Code

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.

1 participant