Skip to content

Commit

Permalink
Trac #31732: ManifoldSubset: New methods declare_empty, declare_nonem…
Browse files Browse the repository at this point in the history
…pty, is_empty, has_defined_points, open_cover_family

A subset is declared empty by giving it (or any superset) an open cover
that is an empty family.

A subset is declared nonempty by defining a point on it (or on any
subset).

URL: https://trac.sagemath.org/31732
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Michael Jung
  • Loading branch information
Release Manager committed Jun 20, 2021
2 parents fad6576 + 359dde1 commit 3a36b12
Show file tree
Hide file tree
Showing 2 changed files with 309 additions and 19 deletions.
3 changes: 3 additions & 0 deletions src/sage/manifolds/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ def __init__(self, parent, coords=None, chart=None, name=None,
sage: TestSuite(q).run()
"""
if parent.is_empty():
raise TypeError(f'cannot define a point on the {parent} because it has been declared empty')
Element.__init__(self, parent)
parent._has_defined_points = True
self._manifold = parent.manifold() # a useful shortcut
self._coordinates = {} # dictionary of the point coordinates in various
# charts, with the charts as keys
Expand Down
Loading

0 comments on commit 3a36b12

Please sign in to comment.