-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
parse_latex support \lg #23618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parse_latex support \lg #23618
Conversation
✅ Hi, I am the SymPy bot (v167). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.11. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) before after ratio
[77f1d79c] [7b38d1d8]
<sympy-1.10.1^0>
+ 110±1ms 199±3ms 1.81 sum.TimeSum.time_doit
Full benchmark results can be found as artifacts in GitHub Actions |
Doesn't lg usually mean the base 2 logarithm? |
There seems to be an ISO standard https://en.m.wiktionary.org/wiki/lg#Usage_notes but it’s not widely used in English-language literature. I learned it to be base 10 in China. |
I also find this confusing sympy/sympy/parsing/latex/_parse_latex_antlr.py Lines 432 to 433 in 6a04cdb
as our latex printer uses |
|
1d86bd0
to
09589db
Compare
I think we can provide some config like |
Ideally we'd be using a parser that is way more user customizable an runtime extensible than the current one, to the point that having specific options like that would be unnecessary. For instance, could we have a parser where the flag can be something along the lines of |
If the purpose is restricted to "for FUNCTION patterns that are already defined in LaTeX.g4, use a mapping to control the parser", then I believe it's doable. |
My point is just that we shouldn't lock ourselves into any public customization APIs for parse_latex if we are likely to switch to another parser in the future which would have much more general customizability. |
If a new parser can't handle simple configuration, I doubt whether it's worth to switch. |
Can the ANTLR parser be extended at runtime? I'm also not a fan of the way the ANTLR parser pins to a specific version of the runtime. That makes it harder for people to install it in an environment where something also also depends on the runtime. |
I think that the change is OK, but that the release note probably can be expanded to clarify what the different options are, i.e., which "log"-command is using what base.
|
I don't think so. |
09589db
to
ff4b804
Compare
References to other Issues or PRs
Brief description of what is fixed or changed
Simply add \lg.
Other comments
Release Notes