Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 7f79a2d

Browse files
committed
Merge branch 'u/rws/24062' of git://trac.sagemath.org/sage into t/22024/symbolic_placeholder_for_complex_root
2 parents bc45dab + 94f359f commit 7f79a2d

17 files changed

+978
-223
lines changed

build/pkgs/sympy/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=sympy-VERSION.tar.gz
2-
sha1=370707a29cda59b696433107d44048dfa3ebafcd
3-
md5=43e797de799f00f9e8fd2307dba9fab1
4-
cksum=58295624
2+
sha1=d5acc09a7429de76713898728f1ec50a3c48e133
3+
md5=c410a9c2346878716d16ec873d72e72a
4+
cksum=3457785807
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.p4
1+
1.1.1

build/pkgs/sympy/patches/01_undeffun_sage.patch

Lines changed: 0 additions & 18 deletions
This file was deleted.

build/pkgs/sympy/patches/02_undeffun_sage.patch

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/sympy/core/function.py b/sympy/core/function.py
2+
index cda559716..12a83e7a3 100644
3+
--- a/sympy/core/function.py
4+
+++ b/sympy/core/function.py
5+
@@ -771,6 +771,16 @@ def _sage_(self):
6+
func = sage.function(fname)(*args)
7+
return func
8+
9+
+class UndefSage(object):
10+
+ def __get__(self, ins, typ):
11+
+ from sage.calculus.var import function
12+
+ if ins is None:
13+
+ return lambda: function(typ.__name__)
14+
+ else:
15+
+ args = [arg._sage_() for arg in ins.args]
16+
+ return lambda : function(ins.__class__.__name__)(*args)
17+
+
18+
+
19+
class UndefinedFunction(FunctionClass):
20+
"""
21+
The (meta)class of undefined functions.
22+
@@ -780,6 +790,7 @@ def __new__(mcl, name, bases=(AppliedUndef,), __dict__=None, **kwargs):
23+
__dict__.update(kwargs)
24+
__dict__['__module__'] = None # For pickling
25+
ret = super(UndefinedFunction, mcl).__new__(mcl, name, bases, __dict__)
26+
+ ret._sage_ = UndefSage()
27+
return ret
28+
29+
def __instancecheck__(cls, instance):

build/pkgs/sympy/patches/fix-dmp_ff_div-by-simplifying-gmpy-rationals-divisio.patch

Lines changed: 0 additions & 67 deletions
This file was deleted.

build/pkgs/sympy/patches/relations_sage.patch

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/doc/en/reference/interfaces/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ and testing to make sure nothing funny is going on).
102102
sage/interfaces/sage0
103103
sage/interfaces/scilab
104104
sage/interfaces/singular
105+
sage/interfaces/sympy
105106
sage/interfaces/tachyon
106107
sage/interfaces/tides
107108

src/sage/calculus/calculus.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ def symbolic_sum(expression, v, a, b, algorithm='maxima', hold=False):
650650
elif algorithm == 'sympy':
651651
expression,v,a,b = [expr._sympy_() for expr in (expression, v, a, b)]
652652
from sympy import summation
653+
from sage.interfaces.sympy import sympy_init
654+
sympy_init()
653655
result = summation(expression, (v, a, b))
654656
try:
655657
return result._sage_()
@@ -894,6 +896,8 @@ def symbolic_product(expression, v, a, b, algorithm='maxima', hold=False):
894896
elif algorithm == 'sympy':
895897
expression,v,a,b = [expr._sympy_() for expr in (expression, v, a, b)]
896898
from sympy import product as sproduct
899+
from sage.interfaces.sympy import sympy_init
900+
sympy_init()
897901
result = sproduct(expression, (v, a, b))
898902
try:
899903
return result._sage_()
@@ -1536,6 +1540,8 @@ def laplace(ex, t, s, algorithm='maxima'):
15361540
elif algorithm == 'sympy':
15371541
ex_sy, t, s = [expr._sympy_() for expr in (ex, t, s)]
15381542
from sympy import laplace_transform
1543+
from sage.interfaces.sympy import sympy_init
1544+
sympy_init()
15391545
result = laplace_transform(ex_sy, t, s)
15401546
if isinstance(result, tuple):
15411547
try:
@@ -1702,6 +1708,8 @@ def inverse_laplace(ex, s, t, algorithm='maxima'):
17021708
elif algorithm == 'sympy':
17031709
ex_sy, s, t = [expr._sympy_() for expr in (ex, s, t)]
17041710
from sympy import inverse_laplace_transform
1711+
from sage.interfaces.sympy import sympy_init
1712+
sympy_init()
17051713
result = inverse_laplace_transform(ex_sy, s, t)
17061714
try:
17071715
return result._sage_()

src/sage/calculus/test_sympy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
108108
::
109109
110-
sage: e = sympify(1)/cos(x)**3; e
110+
sage: e = (1/cos(x)^3)._sympy_(); e
111111
cos(x)**(-3)
112112
sage: f = e.series(x, 0, 10); f
113113
1 + 3*x**2/2 + 11*x**4/8 + 241*x**6/240 + 8651*x**8/13440 + O(x**10)
@@ -138,12 +138,12 @@
138138
sage: e._sage_().taylor(x._sage_(), 0, 8)
139139
8651/13440*x^8 + 241/240*x^6 + 11/8*x^4 + 3/2*x^2 + 1
140140
sage: f._sage_()
141-
8651/13440*x^8 + 241/240*x^6 + 11/8*x^4 + 3/2*x^2 + 1
141+
8651/13440*x^8 + 241/240*x^6 + 11/8*x^4 + 3/2*x^2 + Order(x^10) + 1
142142
143143
Mixing SymPy with Sage::
144144
145145
sage: import sympy
146-
sage: sympy.sympify(var("y"))+sympy.Symbol("x")
146+
sage: var("x")._sympy_() + var("y")._sympy_()
147147
x + y
148148
sage: o = var("omega")
149149
sage: s = sympy.Symbol("x")

0 commit comments

Comments
 (0)