-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add set operators printing for MathML content printer #17545
Conversation
✅ Hi, I am the SymPy bot (v149). 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.6. 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. |
Delete test files
a132ac8
to
36a0f81
Compare
Codecov Report
@@ Coverage Diff @@
## master #17545 +/- ##
=============================================
+ Coverage 74.711% 74.745% +0.034%
=============================================
Files 633 633
Lines 164617 164634 +17
Branches 38657 38660 +3
=============================================
+ Hits 122987 123056 +69
+ Misses 36235 36189 -46
+ Partials 5395 5389 -6 |
@sylee957 Any updates on this? |
I’d mark this for review, since the only thing that is needed is verifying how correct the content printing is. |
I tried a few online mathml viewers with some of the examples here and they just show the letters with no mathematical symbols. |
Which online viewer are you referring to? |
assert mathml(ProductSet(C1, C2)) == \ | ||
'<apply><cartesianproduct/><apply><setdiff/><set><ci>a</ci></set>' \ | ||
'<set><ci>b</ci></set></apply><apply><setdiff/><set>' \ | ||
'<ci>c</ci></set><set><ci>d</ci></set></apply></apply>' |
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.
Should this example have brackets? It comes out as roughly a - b x c - d
but I think it should be (a - b) x (c - d)
.
I tried e.g. this one: https://www-archive.mozilla.org/projects/mathml/demo/tester That doesn't seem to work too well though. I just checked what they look like in a local html file with chrome and they come out looking nice. |
Okay, I can explain the reasons behind
So I think that the |
Okay I'll merge this now. The standard says
From that I don't know whether the display form should have brackets or not but this can always be fixed later if we find some other way to test it. |
I think that this is causing the failing in the master. I don’t know what was going wrong from here, but will figure it out |
References to other Issues or PRs
#17538
Brief description of what is fixed or changed
In #17538 I've mentioned mathml printing for set operators. I had implemented most of the set operators except for
SymmetricDifference
, which may not exist as not mentioned in the doc.However, I see there are some problems with mathjax renders which have to be investigated.
Other comments
I'm not sure why this happens in mathjax.Can anyone confirm that this is a correct markup?
It is the upstream issue that the parenthesis do not appear on some mathml content printing mathjax/MathJax#2184
For example, plus and times work well in similar syntax, but only some set operators are not properly parenthesized
Release Notes
FiniteSet
printing in mathml content markup.Union
,Intersection
,Complement
, andProductSet
printing for mathml content markup.