Skip to content
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

Fixed LaTeX-printing of ConditionSet with FiniteSet #15978

Merged
merged 1 commit into from Feb 17, 2019

Conversation

oscargus
Copy link
Contributor

References to other Issues or PRs

Fixes #15353

Brief description of what is fixed or changed

LaTeX printing of ConditionSet with a FiniteSet used to throw an exception. Now it prints.

ConditionSet((x, a), {sin(a*x), cos(a*x)}, Complexes(Reals x Reals, False))

prints as

image

No idea if it is correct, but it matches exactly what the issue reporter thought would be a good result and since I only did a minor change, I think it can be correct also for other cases.

Other comments

Release Notes

  • printing
    • LaTeX-printing of ConditionSetwith FiniteSet now works.

@sympy-bot
Copy link

sympy-bot commented Feb 13, 2019

Hi, I am the SymPy bot (v137). 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:

  • printing
    • LaTeX-printing of ConditionSetwith FiniteSet now works. (#15978 by @oscargus)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.4.

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.

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234". See
https://github.com/blog/1506-closing-issues-via-pull-requests . Please also
write a comment on that issue linking back to this pull request once it is
open. -->
Fixes #15353 

#### Brief description of what is fixed or changed
LaTeX printing of ConditionSet with a FiniteSet used to throw an exception. Now it prints.

`ConditionSet((x, a), {sin(a*x), cos(a*x)}, Complexes(Reals x Reals, False))`

prints as

![image](https://user-images.githubusercontent.com/8114497/52733424-fad5fe80-2fc2-11e9-87ce-ea9acf67314b.png)

No idea if it is correct, but it matches exactly what the issue reporter thought would be a good result and since I only did a minor change, I think it can be correct also for other cases.

#### Other comments


#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* printing
   * LaTeX-printing of `ConditionSet`with `FiniteSet` now works.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@oscargus
Copy link
Contributor Author

I'm taking the liberty of merging some printing related PR without external review. Still better than an error.

@oscargus oscargus merged commit 456d685 into sympy:master Feb 17, 2019
@oscargus oscargus deleted the latexconditionset branch February 17, 2019 14:38
@moorepants
Copy link
Member

@oscargus FYI, self merging is frowned upon in SymPy. Please get at least 1 person to review.

@asmeurer
Copy link
Member

You should test the set directly. The output of solve could change, and anyway it's unnecessary to perform the solve as part of the test.

@oscargus
Copy link
Contributor Author

@asmeurer Makes sense. I'll make a new PR and let it pass the standard review process.

@moorepants I agree that in general that is clearly for good reasons. However, compared to many other areas, printing, especially getting things that didn't work to work, seems like a relatively non-critical part and somehow it is better for the community to focus on reviewing my other ten or so open PRs that actually affects the behavior. (Although, admittedly, there was something to improve in this particular one.) The main reason to try to merge them rather quickly is to avoid lots of unnecessary test runs caused by merge conflicts in the test files since there is quite a bit of work in that area now. But clearly, I'll try to be more patient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latex of ConditionSet gives 'FiniteSet' object has no attribute 'as_expr'
4 participants