Skip to content

Update SymPy profile: SymPy's latex() can now print set and frozenset#1773

Merged
minrk merged 2 commits into
ipython:masterfrom
asmeurer:sympy_set
Jun 1, 2012
Merged

Update SymPy profile: SymPy's latex() can now print set and frozenset#1773
minrk merged 2 commits into
ipython:masterfrom
asmeurer:sympy_set

Conversation

@asmeurer
Copy link
Copy Markdown
Contributor

I've included a version check against the latest version of SymPy that
supports it (the current development version, 0.7.1-git), so that users of old
versions of SymPy where this doesn't work will still have a good user
experience. This is a continuation of pull request #1399.

I've included a version check against the latest version of SymPy that
supports it (the current development version, 0.7.1-git), so that users of old
versions of SymPy where this doesn't work will still have a good user
experience.  This is a continuation of pull request ipython#1399.
@minrk
Copy link
Copy Markdown
Member

minrk commented May 29, 2012

It seems a bit odd for IPython to test for an unreleased version of SymPy.

A related question: why isn't sympy shipping this extension itself, so that users could do:

%load_ext sympy.ipythonextensions

?

Obviously, there are advantages to it being on either side, but I think it belongs in sympy in the long run.

@asmeurer
Copy link
Copy Markdown
Contributor Author

I agree. See http://code.google.com/p/sympy/issues/detail?id=2945. The short answer is that we haven't gotten around to it yet.

@asmeurer
Copy link
Copy Markdown
Contributor Author

I included the version check because this only works with the latest development version. Before the SymPy fix, latex(set) would just return the string form of the set, which doesn't play well with MathJax (obviously), so if you release before we do, printing of sets will be broken for anyone using the latest released versions of SymPy and IPython (and even if you don't it will be broken for anyone using an older version of SymPy).

@minrk
Copy link
Copy Markdown
Member

minrk commented May 29, 2012

I appreciate that, but I would want to just test for 0.7.2, which will always get the right answer for released software.

@asmeurer
Copy link
Copy Markdown
Contributor Author

That's fine too. I just used this because I don't really know how soon there will be a 0.7.2, and I thought some users might want this now. But I will gladly change it if that's what you want.

@asmeurer
Copy link
Copy Markdown
Contributor Author

So which would you prefer? It doesn't matter to me. Unlike with the previous PR, there aren't really any major SymPy functions that return sets or frozensets, so this probably isn't a huge deal to anyone actually using the SymPy extension with the notebook.

@minrk
Copy link
Copy Markdown
Member

minrk commented May 31, 2012

Is there a test equivalent to version_info > (0,7,1) that would properly identify any version after 0.7.1 including dev? I would do that.

@asmeurer
Copy link
Copy Markdown
Contributor Author

Ah yes, of course. That just requires reordering the logic.

@minrk
Copy link
Copy Markdown
Member

minrk commented Jun 1, 2012

Thanks, merging.

minrk added a commit that referenced this pull request Jun 1, 2012
Update SymPy profile: SymPy's latex() can now print set and frozenset
@minrk minrk merged commit dbad051 into ipython:master Jun 1, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Update SymPy profile: SymPy's latex() can now print set and frozenset
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.

2 participants