Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Updating sympy profile to match the exec_lines of isympy. #582

Merged
merged 2 commits into from

2 participants

@ellisonbg
Owner

This updates the sympy profile to match isympy exactly in terms of what is imported and the symbols that are declared.

@ellisonbg
Owner

This should go into 0.11.

@minrk
Owner

Seems fine to me. Do you want the pretty printing to match the defaults in isympy, rather than plain Unicode?

@ellisonbg
Owner
@minrk
Owner

ascii pretty printing is on by default in isympy.

@minrk
Owner

@ellisonbg: were you going to finish updating this to match isympy?

I think this is the last thing rc4 is waiting for.

@ellisonbg ellisonbg merged commit 09b275e into ipython:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 18, 2011
  1. @ellisonbg
  2. @ellisonbg

    Adding basic types (list, dict ,etc) to the sympy profile.

    ellisonbg authored
    This brings the sympy profile into synch with isympy.
This page is out of date. Refresh to see the latest.
View
6 IPython/config/profile/sympy/ipython_config.py
@@ -8,9 +8,9 @@
lines = """
from __future__ import division
from sympy import *
-x, y, z = symbols('x,y,z')
-k, m, n = symbols('k,m,n', integer=True)
-f, g, h = map(Function, 'fgh')
+x, y, z, t = symbols('x y z t')
+k, m, n = symbols('k m n', integer=True)
+f, g, h = symbols('f g h', cls=Function)
"""
# You have to make sure that attributes that are containers already
View
5 IPython/extensions/sympyprinting.py
@@ -55,6 +55,10 @@ def load_ipython_extension(ip):
global _loaded
if not _loaded:
plaintext_formatter = ip.display_formatter.formatters['text/plain']
+
+ for cls in (object, tuple, list, set, frozenset, dict, str):
+ plaintext_formatter.for_type(cls, print_basic_unicode)
+
plaintext_formatter.for_type_by_name(
'sympy.core.basic', 'Basic', print_basic_unicode
)
@@ -63,6 +67,7 @@ def load_ipython_extension(ip):
)
png_formatter = ip.display_formatter.formatters['image/png']
+
png_formatter.for_type_by_name(
'sympy.core.basic', 'Basic', print_png
)
Something went wrong with that request. Please try again.