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

Commit

Permalink
Check of chart with isinstance(basis, Chart) in FreeModuleTensor._pre…
Browse files Browse the repository at this point in the history
…parse_display
  • Loading branch information
egourgoulhon committed Apr 14, 2019
1 parent d975e85 commit b97afe2
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/sage/tensor/modules/free_module_tensor.py
Expand Up @@ -199,6 +199,7 @@ class being:
from sage.tensor.modules.tensor_with_indices import TensorWithIndices
from sage.parallel.decorate import parallel
from sage.parallel.parallelism import Parallelism
from sage.manifolds.chart import Chart


class FreeModuleTensor(ModuleElement):
Expand Down Expand Up @@ -575,20 +576,13 @@ def _preparse_display(self, basis=None, format_spec=None):
"""
if basis is None:
basis = self._fmodule._def_basis
else:
try:
frame = basis.frame()
# if this succeeds, basis is actually not a module basis, but
# is assumed to be a "format specification" that carries a
# genuine basis via the attribute frame() (this holds for
# coordinate charts on manifolds, the basis returned by frame()
# being the coordinate vector frame)
if format_spec is None:
format_spec = basis
basis = frame
except AttributeError:
# case of a genuine basis
pass
elif isinstance(basis, Chart):
# a coordinate chart has been passed instead of a basis;
# the basis is then assumed to be the coordinate frame
# associated to the chart:
if format_spec is None:
format_spec = basis
basis = basis.frame()
return (basis, format_spec)

def display(self, basis=None, format_spec=None):
Expand Down

0 comments on commit b97afe2

Please sign in to comment.