From 1b6878559ad75aa0064503a962c8c183e13ab91a Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 25 Nov 2020 11:44:40 -0500 Subject: [PATCH] eja: fix an implicit TODO by eliminating lazy_import. --- mjo/eja/eja_algebra.py | 5 ++--- mjo/eja/eja_element.py | 6 +----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 21718ee..933603a 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -24,15 +24,12 @@ from sage.combinat.free_module import CombinatorialFreeModule from sage.matrix.constructor import matrix from sage.matrix.matrix_space import MatrixSpace from sage.misc.cachefunc import cached_method -from sage.misc.lazy_import import lazy_import from sage.misc.table import table from sage.modules.free_module import FreeModule, VectorSpace from sage.rings.all import (ZZ, QQ, AA, QQbar, RR, RLF, CLF, PolynomialRing, QuadraticField) from mjo.eja.eja_element import FiniteDimensionalEuclideanJordanAlgebraElement -lazy_import('mjo.eja.eja_subalgebra', - 'FiniteDimensionalEuclideanJordanSubalgebra') from mjo.eja.eja_operator import FiniteDimensionalEuclideanJordanAlgebraOperator from mjo.eja.eja_utils import _mat2vec @@ -768,6 +765,8 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): if not c.is_idempotent(): raise ValueError("element is not idempotent: %s" % c) + from mjo.eja.eja_subalgebra import FiniteDimensionalEuclideanJordanSubalgebra + # Default these to what they should be if they turn out to be # trivial, because eigenspaces_left() won't return eigenvalues # corresponding to trivial spaces (e.g. it returns only the diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 5a0b213..120870b 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -2,11 +2,6 @@ from sage.matrix.constructor import matrix from sage.modules.free_module import VectorSpace from sage.modules.with_basis.indexed_element import IndexedFreeModuleElement -# TODO: make this unnecessary somehow. -from sage.misc.lazy_import import lazy_import -lazy_import('mjo.eja.eja_algebra', 'FiniteDimensionalEuclideanJordanAlgebra') -lazy_import('mjo.eja.eja_element_subalgebra', - 'FiniteDimensionalEuclideanJordanElementSubalgebra') from mjo.eja.eja_operator import FiniteDimensionalEuclideanJordanAlgebraOperator from mjo.eja.eja_utils import _mat2vec @@ -1331,6 +1326,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): True """ + from mjo.eja.eja_element_subalgebra import FiniteDimensionalEuclideanJordanElementSubalgebra return FiniteDimensionalEuclideanJordanElementSubalgebra(self, orthonormalize_basis) -- 2.44.2