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

Commit

Permalink
Trac #30228: Declare Sections with Name only
Browse files Browse the repository at this point in the history
At this stage we have the following difference between sections and
tensor fields:

{{{
sage: M = Manifold(2, 'M', start_index=1)
....: X.<x,y> = M.chart()
....: E = M.vector_bundle(2, 'E')
....: e = E.local_frame('e')
....: v = M.vector_field('v')
....: s = E.section('s')
Traceback (most recent call last)
...
IndexError: string index out of range
}}}

This simply comes from the fact that the method `section` does not like
pure strings as input, in contrast to `vector_field` or `tensor`.

URL: https://trac.sagemath.org/30228
Reported by: gh-mjungmath
Ticket author(s): Michael Jung
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager committed Aug 1, 2020
2 parents 2279b17 + 78692a6 commit acf0263
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=eac827f97c1258cf6524a81084172a43bf7c4680
md5=bf07fb027bc4c586edf10132298fa363
cksum=546608769
sha1=9d04a7066f0c543084ac8249cb280c86d2bf867d
md5=ac1516d0c732111da045ff977b68230c
cksum=2699179254
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e41d396f5d30996ae515399b28675a60e97a1996
ddd5258c401e17c0ecfb66bdf0b294133abbb4b9
3 changes: 3 additions & 0 deletions src/sage/manifolds/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ def _init_components(self, *comp, **kwargs):
# frame is actually a pair (frame, chart):
frame, chart = frame
self.add_comp(frame)[:, chart] = components
elif isinstance(comp0, str):
# For consistency with tensor fields:
self.set_name(comp0)
else:
if hasattr(comp0, '__getitem__'):
# comp0 is a list/vector of components
Expand Down

0 comments on commit acf0263

Please sign in to comment.