-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Many different printing fixes #17080
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
Many different printing fixes #17080
Conversation
|
✅ Hi, I am the SymPy bot (v147). 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.5. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
|
Resulting code for Mathematica and Octave printers for almost all functions in Before:
After:
Note that it says that some Mathematica functions are not supported in the after table. They were not supported earlier either. Just that it wasn't shown. |
|
It seems from travis build that some of the doctests are failing. |
sympy/printing/codeprinter.py
Outdated
| return self._print_Function(expr) | ||
| else: | ||
| from sympy.functions.special.error_functions import erf | ||
| return self._print(erf(expr.args[1]) - erf(expr.args[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe should do rewrite here instead.
sympy/printing/codeprinter.py
Outdated
| return self._print_Function(expr) | ||
| else: | ||
| from sympy.functions.special.error_functions import li | ||
| return self._print(li(expr.args[0]) - li(2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
|
Yes, both because e.g. LambertW is now printed as W and because the "Not supported"-comments in Mathematica. Not sure if it was a good idea to add those... This is not really the output that one would prefer: will look more into it later. Will update the failing tests once I add tests for the new code. |
Codecov Report
@@ Coverage Diff @@
## master #17080 +/- ##
=============================================
- Coverage 74.459% 74.451% -0.008%
=============================================
Files 623 623
Lines 161114 161159 +45
Branches 37814 37827 +13
=============================================
+ Hits 119964 119986 +22
- Misses 35820 35847 +27
+ Partials 5330 5326 -4 |
|
Some updates: I removed the unsupported function printing for Mathematica (and updated the release notes). It makes sense to not have it since Mathematica just leaves unknown functions as an undefined function. I added a dict in CodePrinter, From my side, this is good to go. |
|
Looks good |


References to other Issues or PRs
Brief description of what is fixed or changed
Unfortunately this is a mess of fixes, although all are related to printing. Probably the easiest is to check the release notes and the code to see what has changed. I will add some before and after tables in the comments.
No tests yet, but they will come.
Other comments
Release Notes
erf2andLiare printed usingerfandli, respectively, if the latter is supported, but not the former for all code printers.LambertWprinting for LaTeX, pretty, and MathML presentation.