Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 4e316e9

Browse files
committed
Fix bug in Chart.__init__ regarding the determination of top charts (Trac #32112)
1 parent 473cd41 commit 4e316e9

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/sage/manifolds/chart.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,16 @@ def __init__(self, domain, coordinates='', names=None, calc_method=None):
277277
[]
278278
sage: TestSuite(X).run()
279279
280+
Check that :trac:`32112` has been fixed::
281+
282+
sage: M = Manifold(2, 'M', structure='topological')
283+
sage: U = M.open_subset('U')
284+
sage: V = M.open_subset('V')
285+
sage: XU = U.chart('x y')
286+
sage: XV = V.chart('x y')
287+
sage: M.top_charts()
288+
[Chart (U, (x, y)), Chart (V, (x, y))]
289+
280290
"""
281291
from sage.manifolds.manifold import TopologicalManifold
282292
if not isinstance(domain, TopologicalManifold):
@@ -321,10 +331,11 @@ def __init__(self, domain, coordinates='', names=None, calc_method=None):
321331
# atlases of the domain's supersets; moreover the first defined chart
322332
# is considered as the default chart
323333
for sd in self._domain.open_supersets():
324-
# the chart is added in the top charts only if its coordinates have
325-
# not been used:
334+
# the chart is added in the top charts iff its coordinates have
335+
# not been used on a domain including the chart's domain:
326336
for chart in sd._atlas:
327-
if self._xx == chart._xx:
337+
if (self._domain.is_subset(chart._domain)
338+
and self._xx == chart._xx):
328339
break
329340
else:
330341
sd._top_charts.append(self)

0 commit comments

Comments
 (0)