summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-12-16 18:12:18 +0100
committerEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-12-16 18:12:18 +0100
commitce0350398939873c5273bac486dc858e42d9b497 (patch)
tree246010b4c9cdc9c67c9c822384d5549870f6d165
parentScalar fields on the refactored topoological manifolds (diff)
parentAdd argument full_name to AbstractNamedObject; remove _repr_() from all paren... (diff)
Scalar fields on topological manifolds: slight improvements in the documentation
-rw-r--r--src/sage/manifolds/abstract.py29
-rw-r--r--src/sage/manifolds/manifold.py12
2 files changed, 33 insertions, 8 deletions
diff --git a/src/sage/manifolds/abstract.py b/src/sage/manifolds/abstract.py
index 35d9198..7bab86e 100644
--- a/src/sage/manifolds/abstract.py
+++ b/src/sage/manifolds/abstract.py
@@ -29,10 +29,11 @@ from sage.rings.integer import Integer
from sage.manifolds.point import ManifoldPoint
class AbstractNamedObject(object):
- """
- An abstract object.
+ r"""
+ An abstract named object.
- An abstract object is a variable name and LaTeX name.
+ This abstract class handles the outputs (text and LaTeX) of named objects
+ (e.g. parent objects in manifold classes).
INPUT:
@@ -42,6 +43,28 @@ class AbstractNamedObject(object):
- ``full_name`` -- (default: ``None``) string; short description of the
object; if ``None``, the description is set to ``name``.
+ EXAMPLES::
+
+ sage: from sage.manifolds.abstract import AbstractNamedObject
+ sage: a = AbstractNamedObject('A', latex_name=r'\mathcal{A}',
+ ....: full_name='Object A')
+ sage: a._repr_()
+ 'Object A'
+ sage: a._latex_()
+ '\\mathcal{A}'
+ sage: latex(a)
+ \mathcal{A}
+
+ Using default values::
+
+ sage: a = AbstractNamedObject('A')
+ sage: a._repr_()
+ 'A'
+ sage: a._latex_()
+ 'A'
+ sage: latex(a)
+ A
+
"""
def __init__(self, name, latex_name=None, full_name=None):
"""
diff --git a/src/sage/manifolds/manifold.py b/src/sage/manifolds/manifold.py
index 582ea03..31adefa 100644
--- a/src/sage/manifolds/manifold.py
+++ b/src/sage/manifolds/manifold.py
@@ -336,8 +336,8 @@ from sage.manifolds.abstract import AbstractSet
from sage.manifolds.structure import TopologicalStructure, \
RealTopologicalStructure
-#####################################################################
-## Classes
+#############################################################################
+## Class
class TopologicalManifold(AbstractSet):
r"""
@@ -370,7 +370,9 @@ class TopologicalManifold(AbstractSet):
:class:`~sage.categories.topological_spaces.TopologicalSpaces`)
for other types of manifolds
- - ``structure`` -- manifold structure
+ - ``structure`` -- manifold structure (see
+ :class:`~sage.manifolds.structure.TopologicalStructure` or
+ :class:`~sage.manifolds.structure.RealTopologicalStructure`)
- ``latex_name`` -- (default: ``None``) string; LaTeX symbol to
denote the manifold; if none is provided, it is set to ``name``
- ``full_name`` -- (default: ``None``) string; short description of the
@@ -568,6 +570,7 @@ class TopologicalManifold(AbstractSet):
# List of charts that individually cover self, i.e. whose
# domains are self (if non-empty, self is a coordinate domain):
self._covering_charts = []
+ self._open_covers.append([self]) # list of open covers of self
# Algebra of scalar fields defined on self:
self._scalar_field_algebra = self._structure.scalar_field_algebra(self)
# The zero scalar field:
@@ -575,8 +578,6 @@ class TopologicalManifold(AbstractSet):
# The unit scalar field:
self._one_scalar_field = self._scalar_field_algebra.one()
- self._open_covers.append([self]) # list of open covers of self
-
def _an_element_(self):
r"""
Construct some point on the manifold.
@@ -1821,6 +1822,7 @@ class TopologicalManifold(AbstractSet):
return self._one_scalar_field
##############################################################################
+## Constructor function
def Manifold(dim, name, latex_name=None, field='real', structure='smooth',
start_index=0, **extra_kwds):