Skip to content

Commit

Permalink
Trac #31727: ManifoldSubset: Add methods subset_family, superset_fami…
Browse files Browse the repository at this point in the history
…ly, open_superset_family; deprecate method list_of_subsets

Follow-up from #31718.

This ticket proposes to deprecate `list_of_subsets` (note - no other
methods in `sage.manifolds` follow this naming scheme) in favor of a new
method `subset_family`, which prints in a more compact way, is hashable,
and is sorted by name too.

We also add `superset_family` (previously the set of supersets was not
exposed by a method).

We also add `open_superset_family` (to complement `open_superset` added
in #31677).

URL: https://trac.sagemath.org/31727
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Eric Gourgoulhon
  • Loading branch information
Release Manager committed Jun 20, 2021
2 parents a4cb623 + 2b47b1b commit fad6576
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 119 deletions.
14 changes: 5 additions & 9 deletions src/sage/manifolds/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,9 @@ def transition_map(self, other, transformations, intersection_name=None,
The subset `W`, intersection of `U` and `V`, has been created by
``transition_map()``::
sage: M.list_of_subsets()
[1-dimensional topological manifold S^1,
Open subset U of the 1-dimensional topological manifold S^1,
Open subset V of the 1-dimensional topological manifold S^1,
Open subset W of the 1-dimensional topological manifold S^1]
sage: W = M.list_of_subsets()[3]
sage: F = M.subset_family(); F
Set {S^1, U, V, W} of open subsets of the 1-dimensional topological manifold S^1
sage: W = F['W']
sage: W is U.intersection(V)
True
sage: M.atlas()
Expand All @@ -956,9 +953,8 @@ def transition_map(self, other, transformations, intersection_name=None,
In this case, no new subset has been created since `U \cap M = U`::
sage: M.list_of_subsets()
[2-dimensional topological manifold R^2,
Open subset U of the 2-dimensional topological manifold R^2]
sage: M.subset_family()
Set {R^2, U} of open subsets of the 2-dimensional topological manifold R^2
but a new chart has been created: `(U, (x, y))`::
Expand Down
14 changes: 5 additions & 9 deletions src/sage/manifolds/differentiable/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,9 @@ def transition_map(self, other, transformations, intersection_name=None,
The subset `W`, intersection of `U` and `V`, has been created by
``transition_map()``::
sage: M.list_of_subsets()
[1-dimensional differentiable manifold S^1,
Open subset U of the 1-dimensional differentiable manifold S^1,
Open subset V of the 1-dimensional differentiable manifold S^1,
Open subset W of the 1-dimensional differentiable manifold S^1]
sage: W = M.list_of_subsets()[3]
sage: F = M.subset_family(); F
Set {S^1, U, V, W} of open subsets of the 1-dimensional differentiable manifold S^1
sage: W = F['W']
sage: W is U.intersection(V)
True
sage: M.atlas()
Expand All @@ -385,9 +382,8 @@ def transition_map(self, other, transformations, intersection_name=None,
In this case, no new subset has been created since `U\cap M = U`::
sage: M.list_of_subsets()
[2-dimensional differentiable manifold R^2,
Open subset U of the 2-dimensional differentiable manifold R^2]
sage: M.subset_family()
Set {R^2, U} of open subsets of the 2-dimensional differentiable manifold R^2
but a new chart has been created: `(U, (x, y))`::
Expand Down
10 changes: 5 additions & 5 deletions src/sage/manifolds/differentiable/examples/real_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ class OpenInterval(DifferentiableManifold):
We have::
sage: I.list_of_subsets()
sage: list(I.subset_family())
[Real interval (0, 1), Real interval (0, pi), Real interval (1/2, 1)]
sage: J.list_of_subsets()
sage: list(J.subset_family())
[Real interval (0, 1), Real interval (1/2, 1)]
sage: K.list_of_subsets()
sage: list(K.subset_family())
[Real interval (1/2, 1)]
As any open subset of a manifold, open subintervals are created in a
Expand Down Expand Up @@ -684,7 +684,7 @@ def open_interval(self, lower, upper, name=None, latex_name=None):
Real interval (0, pi)
sage: J.is_subset(I)
True
sage: I.list_of_subsets()
sage: list(I.subset_family())
[Real interval (-4, 4), Real interval (0, pi)]
``J`` is considered as an open submanifold of ``I``::
Expand Down Expand Up @@ -863,7 +863,7 @@ class RealLine(OpenInterval):
Real interval (0, 1)
sage: I.manifold()
Real number line R
sage: R.list_of_subsets()
sage: list(R.subset_family())
[Real interval (0, 1), Real number line R]
"""
Expand Down
19 changes: 6 additions & 13 deletions src/sage/manifolds/differentiable/manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,8 @@
At this stage, we have four open subsets on `S^2`::
sage: M.list_of_subsets()
[2-dimensional differentiable manifold S^2,
Open subset U of the 2-dimensional differentiable manifold S^2,
Open subset V of the 2-dimensional differentiable manifold S^2,
Open subset W of the 2-dimensional differentiable manifold S^2]
sage: M.subset_family()
Set {S^2, U, V, W} of open subsets of the 2-dimensional differentiable manifold S^2
`W` is the open subset that is the complement of the two poles::
Expand Down Expand Up @@ -350,11 +347,8 @@
The following subsets and charts have been defined::
sage: M.list_of_subsets()
[Open subset A of the 1-dimensional complex manifold C*,
1-dimensional complex manifold C*,
Open subset U of the 1-dimensional complex manifold C*,
Open subset V of the 1-dimensional complex manifold C*]
sage: M.subset_family()
Set {A, C*, U, V} of open subsets of the 1-dimensional complex manifold C*
sage: M.atlas()
[Chart (U, (z,)), Chart (V, (w,)), Chart (A, (z,)), Chart (A, (w,))]
Expand Down Expand Up @@ -775,9 +769,8 @@ def open_subset(self, name, latex_name=None, coord_def={}, supersets=None):
We have then::
sage: A.list_of_subsets()
[Open subset A of the 2-dimensional differentiable manifold M,
Open subset B of the 2-dimensional differentiable manifold M]
sage: A.subset_family()
Set {A, B} of open subsets of the 2-dimensional differentiable manifold M
sage: B.is_subset(A)
True
sage: B.is_subset(M)
Expand Down
14 changes: 4 additions & 10 deletions src/sage/manifolds/manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,8 @@
At this stage, we have four open subsets on `S^2`::
sage: M.list_of_subsets()
[2-dimensional topological manifold S^2,
Open subset U of the 2-dimensional topological manifold S^2,
Open subset V of the 2-dimensional topological manifold S^2,
Open subset W of the 2-dimensional topological manifold S^2]
sage: M.subset_family()
Set {S^2, U, V, W} of open subsets of the 2-dimensional topological manifold S^2
`W` is the open subset that is the complement of the two poles::
Expand Down Expand Up @@ -269,11 +266,8 @@
The following subsets and charts have been defined::
sage: M.list_of_subsets()
[Open subset A of the Complex 1-dimensional topological manifold C*,
Complex 1-dimensional topological manifold C*,
Open subset U of the Complex 1-dimensional topological manifold C*,
Open subset V of the Complex 1-dimensional topological manifold C*]
sage: M.subset_family()
Set {A, C*, U, V} of open subsets of the Complex 1-dimensional topological manifold C*
sage: M.atlas()
[Chart (U, (z,)), Chart (V, (w,)), Chart (A, (z,)), Chart (A, (w,))]
Expand Down
Loading

0 comments on commit fad6576

Please sign in to comment.