summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-08-23 18:48:19 +0200
committerEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-08-23 18:48:19 +0200
commite558c06024e5a7108d857080fb3856bda9f049c1 (patch)
tree046099870fa3762e571c3a19c84570cd65373140
parentAdd doctest to set_axes_labels (diff)
Improvement in simplify_sqrt_real(); TestSuite run non-verbose
-rw-r--r--src/doc/en/reference/manifolds/index.rst8
-rw-r--r--src/sage/manifolds/chart.py6
-rw-r--r--src/sage/manifolds/manifold.py20
-rw-r--r--src/sage/manifolds/manifold_homset.py45
-rw-r--r--src/sage/manifolds/scalarfield_algebra.py31
-rw-r--r--src/sage/manifolds/utilities.py12
6 files changed, 19 insertions, 103 deletions
diff --git a/src/doc/en/reference/manifolds/index.rst b/src/doc/en/reference/manifolds/index.rst
index 5d0cb0e..dc41530 100644
--- a/src/doc/en/reference/manifolds/index.rst
+++ b/src/doc/en/reference/manifolds/index.rst
@@ -1,8 +1,8 @@
-Manifolds and tensor fields
-===========================
+Manifolds
+=========
-This is the Sage implementation of manifolds and tensor fields
-resulting from the `SageManifolds project <http://sagemanifolds.obspm.fr/>`_.
+This is the Sage implementation of manifolds resulting from the
+`SageManifolds project <http://sagemanifolds.obspm.fr/>`_.
This section describes only the "manifold" part of SageManifolds;
the pure algebraic part is described in the section
:ref:`tensors-on-free-modules`.
diff --git a/src/sage/manifolds/chart.py b/src/sage/manifolds/chart.py
index 8ef8859..927b73b 100644
--- a/src/sage/manifolds/chart.py
+++ b/src/sage/manifolds/chart.py
@@ -1155,7 +1155,8 @@ class RealChart(Chart):
sage: c_spher
Chart (U, (r, th, ph))
- Note the prefix 'r' for the string defining the coordinates in the arguments of ``Chart``.
+ Note the prefix 'r' for the string defining the coordinates in the
+ arguments of ``chart``.
Coordinates are Sage symbolic variables (see
:mod:`sage.symbolic.expression`)::
@@ -2441,8 +2442,7 @@ class CoordChange(SageObject):
self._transf = chart1.multifunction(*transformations)
self._inverse = None
# If the two charts are on the same open subset, the coordinate change
- # is added to the subset (and supersets) dictionary and the
- # Jacobian matrix is added to the dictionary of changes of frame:
+ # is added to the subset (and supersets) dictionary:
if chart1._domain == chart2._domain:
domain = chart1._domain
for sdom in domain._supersets:
diff --git a/src/sage/manifolds/manifold.py b/src/sage/manifolds/manifold.py
index 0f63a5b..1a8e2d1 100644
--- a/src/sage/manifolds/manifold.py
+++ b/src/sage/manifolds/manifold.py
@@ -414,25 +414,7 @@ class TopManifold(TopManifoldSubset):
The manifold passes all the tests of the test suite relative to the
category of Sets::
- sage: TestSuite(M).run(verbose=True)
- running ._test_an_element() . . . pass
- running ._test_category() . . . pass
- running ._test_elements() . . .
- Running the test suite of self.an_element()
- running ._test_category() . . . pass
- running ._test_eq() . . . pass
- running ._test_not_implemented_methods() . . . pass
- running ._test_pickling() . . . pass
- pass
- running ._test_elements_eq_reflexive() . . . pass
- running ._test_elements_eq_symmetric() . . . pass
- running ._test_elements_eq_transitive() . . . pass
- running ._test_elements_neq() . . . pass
- running ._test_eq() . . . pass
- running ._test_not_implemented_methods() . . . pass
- running ._test_pickling() . . . pass
- running ._test_some_elements() . . . pass
-
+ sage: TestSuite(M).run()
"""
def __init__(self, n, name, latex_name=None, field='real', start_index=0,
diff --git a/src/sage/manifolds/manifold_homset.py b/src/sage/manifolds/manifold_homset.py
index 5a5c282..b734e00 100644
--- a/src/sage/manifolds/manifold_homset.py
+++ b/src/sage/manifolds/manifold_homset.py
@@ -136,50 +136,7 @@ class TopManifoldHomset(Homset, UniqueRepresentation):
sage: TestSuite(E).run()
This test suite includes more tests than in the case of ``H``, since ``E``
- has some extra structure (monoid)::
-
- sage: TestSuite(H).run(verbose=True)
- running ._test_an_element() . . . pass
- running ._test_category() . . . pass
- running ._test_elements() . . .
- Running the test suite of self.an_element()
- running ._test_category() . . . pass
- running ._test_eq() . . . pass
- running ._test_not_implemented_methods() . . . pass
- running ._test_pickling() . . . pass
- pass
- running ._test_elements_eq_reflexive() . . . pass
- running ._test_elements_eq_symmetric() . . . pass
- running ._test_elements_eq_transitive() . . . pass
- running ._test_elements_neq() . . . pass
- running ._test_eq() . . . pass
- running ._test_not_implemented_methods() . . . pass
- running ._test_pickling() . . . pass
- running ._test_some_elements() . . . pass
-
- ::
-
- sage: TestSuite(E).run(verbose=True)
- running ._test_an_element() . . . pass
- running ._test_associativity() . . . pass
- running ._test_category() . . . pass
- running ._test_elements() . . .
- Running the test suite of self.an_element()
- running ._test_category() . . . pass
- running ._test_eq() . . . pass
- running ._test_not_implemented_methods() . . . pass
- running ._test_pickling() . . . pass
- pass
- running ._test_elements_eq_reflexive() . . . pass
- running ._test_elements_eq_symmetric() . . . pass
- running ._test_elements_eq_transitive() . . . pass
- running ._test_elements_neq() . . . pass
- running ._test_eq() . . . pass
- running ._test_not_implemented_methods() . . . pass
- running ._test_one() . . . pass
- running ._test_pickling() . . . pass
- running ._test_prod() . . . pass
- running ._test_some_elements() . . . pass
+ has some extra structure (monoid).
"""
diff --git a/src/sage/manifolds/scalarfield_algebra.py b/src/sage/manifolds/scalarfield_algebra.py
index 5cf30ec..a8f8e25 100644
--- a/src/sage/manifolds/scalarfield_algebra.py
+++ b/src/sage/manifolds/scalarfield_algebra.py
@@ -319,34 +319,9 @@ class ScalarFieldAlgebra(UniqueRepresentation, Parent):
sage: 1/3*(f+2*f) == f
True
- Sage test suite for algebras is passed::
-
- sage: TestSuite(CM).run(verbose=True)
- running ._test_additive_associativity() . . . pass
- running ._test_an_element() . . . pass
- running ._test_associativity() . . . pass
- running ._test_category() . . . pass
- running ._test_characteristic() . . . pass
- running ._test_distributivity() . . . pass
- running ._test_elements() . . .
- Running the test suite of self.an_element()
- running ._test_category() . . . pass
- running ._test_eq() . . . pass
- running ._test_nonzero_equal() . . . pass
- running ._test_not_implemented_methods() . . . pass
- running ._test_pickling() . . . pass
- pass
- running ._test_elements_eq_reflexive() . . . pass
- running ._test_elements_eq_symmetric() . . . pass
- running ._test_elements_eq_transitive() . . . pass
- running ._test_elements_neq() . . . pass
- running ._test_eq() . . . pass
- running ._test_not_implemented_methods() . . . pass
- running ._test_one() . . . pass
- running ._test_pickling() . . . pass
- running ._test_prod() . . . pass
- running ._test_some_elements() . . . pass
- running ._test_zero() . . . pass
+ The Sage test suite for algebras is passed::
+
+ sage: TestSuite(CM).run()
It is passed also for `C^0(W)`::
diff --git a/src/sage/manifolds/utilities.py b/src/sage/manifolds/utilities.py
index 634929b..0412302 100644
--- a/src/sage/manifolds/utilities.py
+++ b/src/sage/manifolds/utilities.py
@@ -126,12 +126,14 @@ def simplify_sqrt_real(expr):
if num < 0 or den < 0:
x = sqrt(-num) / sqrt(-den) # new equivalent expression for x
simpl = SR(x._maxima_().radcan())
- if str(simpl)[:5] != 'sqrt(':
- # the absolute value of radcan's output is taken, the call to simplify()
- # taking into account possible assumptions regarding the sign of simpl:
- ssimpl = str(abs(simpl).simplify())
- else:
+ if str(simpl)[:5] == 'sqrt(' or str(simpl)[:7] == '1/sqrt(':
+ # no further simplification seems possible:
ssimpl = str(simpl)
+ else:
+ # the absolute value of radcan's output is taken, the call to
+ # simplify() taking into account possible assumptions regarding the
+ # sign of simpl:
+ ssimpl = str(abs(simpl).simplify())
# search for abs(1/sqrt(...)) term to simplify it into 1/sqrt(...):
pstart = ssimpl.find('abs(1/sqrt(')
if pstart != -1: