summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-11-17 12:28:43 +0100
committerEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-11-17 12:28:43 +0100
commit66f2c5ad92e5ec778aa73f299f80253c0af5c67a (patch)
tree435143cf42269dfa59ebb4245c1616a98206ccf4
parentCheck for real/complex manifold performed on base_field_type() instead of RR/CC (diff)
Change function('f', x) to function('f')(x) to accomodate the deprecation warning introduced in #17447
-rw-r--r--src/sage/manifolds/coord_func_symb.py8
-rw-r--r--src/sage/manifolds/scalarfield.py4
-rw-r--r--src/sage/manifolds/utilities.py32
3 files changed, 22 insertions, 22 deletions
diff --git a/src/sage/manifolds/coord_func_symb.py b/src/sage/manifolds/coord_func_symb.py
index b9ee4f9..6872152 100644
--- a/src/sage/manifolds/coord_func_symb.py
+++ b/src/sage/manifolds/coord_func_symb.py
@@ -108,7 +108,7 @@ class CoordFunctionSymb(CoordFunction):
An unspecified coordinate function::
- sage: g = X.function(function('G', x, y))
+ sage: g = X.function(function('G')(x, y))
sage: g
G(x, y)
sage: g.display()
@@ -185,7 +185,7 @@ class CoordFunctionSymb(CoordFunction):
Another difference regards the display of partial derivatives: for callable
symbolic functions, it relies on Pynac notation ``D[0]``, ``D[1]``, etc.::
- sage: g = function('g', x, y)
+ sage: g = function('g')(x, y)
sage: f0(x,y) = diff(g, x) + diff(g, y)
sage: f0
(x, y) |--> D[0](g)(x, y) + D[1](g)(x, y)
@@ -224,10 +224,10 @@ class CoordFunctionSymb(CoordFunction):
callable symbolic expression is the possibility to switch off the display
of the arguments of unspecified functions. Consider for instance::
- sage: f = X.function(function('u', x, y) * function('v', x, y))
+ sage: f = X.function(function('u')(x, y) * function('v')(x, y))
sage: f
u(x, y)*v(x, y)
- sage: f0(x,y) = function('u', x, y) * function('v', x, y)
+ sage: f0(x,y) = function('u')(x, y) * function('v')(x, y)
sage: f0
(x, y) |--> u(x, y)*v(x, y)
diff --git a/src/sage/manifolds/scalarfield.py b/src/sage/manifolds/scalarfield.py
index 55cff9a..e3b80eb 100644
--- a/src/sage/manifolds/scalarfield.py
+++ b/src/sage/manifolds/scalarfield.py
@@ -176,7 +176,7 @@ class ScalarField(CommutativeAlgebraElement):
A scalar field can also be defined by some unspecified function of the
coordinates::
- sage: h = U.scalar_field(function('H', x, y), name='h') ; h
+ sage: h = U.scalar_field(function('H')(x, y), name='h') ; h
Scalar field h on the Open subset U of the 2-dimensional topological
manifold M
sage: h.display()
@@ -1368,7 +1368,7 @@ class ScalarField(CommutativeAlgebraElement):
(x, y) |--> sqrt(x + 1)
sage: latex(f.display())
\begin{array}{llcl} f:& M & \longrightarrow & \mathbb{R} \\ & \left(x, y\right) & \longmapsto & \sqrt{x + 1} \end{array}
- sage: g = M.scalar_field(function('G', x, y), name='g')
+ sage: g = M.scalar_field(function('G')(x, y), name='g')
sage: g.display()
g: M --> R
(x, y) |--> G(x, y)
diff --git a/src/sage/manifolds/utilities.py b/src/sage/manifolds/utilities.py
index 568813d..2c8344e 100644
--- a/src/sage/manifolds/utilities.py
+++ b/src/sage/manifolds/utilities.py
@@ -427,9 +427,9 @@ class ExpressionNice(Expression):
sage: var('x y z')
(x, y, z)
- sage: f = function('f', x, y)
+ sage: f = function('f')(x, y)
sage: g = f.diff(y).diff(x)
- sage: h = function('h', y, z)
+ sage: h = function('h')(y, z)
sage: k = h.diff(z)
sage: fun = x*g + y*(k-z)^2
@@ -453,8 +453,8 @@ class ExpressionNice(Expression):
An example when function variables are themselves functions::
- sage: f = function('f', x, y)
- sage: g = function('g', x, f) # the second variable is the function f
+ sage: f = function('f')(x, y)
+ sage: g = function('g')(x, f) # the second variable is the function f
sage: fun = (g.diff(x))*x - x^2*f.diff(x,y)
sage: fun
-x^2*D[0, 1](f)(x, y) + (D[0](f)(x, y)*D[1](g)(x, f(x, y)) + D[0](g)(x, f(x, y)))*x
@@ -513,7 +513,7 @@ class ExpressionNice(Expression):
TESTS::
- sage: f = function('f', x)
+ sage: f = function('f')(x)
sage: df = f.diff(x)
sage: df
D[0](f)(x)
@@ -535,9 +535,9 @@ class ExpressionNice(Expression):
sage: var('x y z')
(x, y, z)
- sage: f = function('f', x, y)
+ sage: f = function('f')(x, y)
sage: g = f.diff(y).diff(x)
- sage: h = function('h', y, z)
+ sage: h = function('h')(y, z)
sage: k = h.diff(z)
sage: fun = x*g + y*(k-z)^2
sage: fun
@@ -614,9 +614,9 @@ class ExpressionNice(Expression):
sage: var('x y z')
(x, y, z)
- sage: f = function('f', x, y)
+ sage: f = function('f')(x, y)
sage: g = f.diff(y).diff(x)
- sage: h = function('h', y, z)
+ sage: h = function('h')(y, z)
sage: k = h.diff(z)
sage: fun = x*g + y*(k-z)^2
sage: fun
@@ -629,14 +629,14 @@ class ExpressionNice(Expression):
Testing the behavior if no latex_name of the function is given::
- sage: f = function('f_x', x, y)
+ sage: f = function('f_x')(x, y)
sage: fun = f.diff(y)
sage: latex(ExpressionNice(fun))
\frac{\partial\,f_{x}}{\partial y}
If latex_name, it should be used in LaTeX output:
- sage: f = function('f_x', x, y, latex_name=r"{\cal F}")
+ sage: f = function('f_x', latex_name=r"{\cal F}")(x,y)
sage: fun = f.diff(y)
sage: latex(ExpressionNice(fun))
\frac{\partial\,{\cal F}}{\partial y}
@@ -730,7 +730,7 @@ def _list_derivatives(ex, list_d, exponent=0):
TESTS::
- sage: f = function('f_x', x, latex_name=r"{\cal F}")
+ sage: f = function('f_x', latex_name=r"{\cal F}")(x)
sage: df = f.diff(x)^2
sage: from sage.manifolds.utilities import _list_derivatives
sage: list_d = []
@@ -793,8 +793,8 @@ def _list_functions(ex, list_f):
sage: var('x y z')
(x, y, z)
- sage: f = function('f', x, y, latex_name=r"{\cal F}")
- sage: g = function('g_x', x, y)
+ sage: f = function('f', latex_name=r"{\cal F}")(x, y)
+ sage: g = function('g_x')(x, y)
sage: d = sin(x)*g.diff(x)*x*f - x^2*f.diff(x,y)/g
sage: from sage.manifolds.utilities import _list_functions
sage: list_f = []
@@ -847,7 +847,7 @@ def nice_derivatives(status):
sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: g = function('g', x, y)
+ sage: g = function('g')(x, y)
sage: f = X.function(diff(g, x) + diff(g, y))
sage: f
d(g)/dx + d(g)/dy
@@ -891,7 +891,7 @@ def omit_function_args(status):
TESTS::
sage: from sage.manifolds.utilities import ExpressionNice
- sage: f = function('f_x', x)
+ sage: f = function('f_x')(x)
sage: f = f*(1 + f^2)
sage: ExpressionNice(f)
(f_x(x)^2 + 1)*f_x(x)