Skip to content

Commit

Permalink
sage.*.all*: Update from #35095
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Nov 8, 2023
1 parent ebef87a commit 79b1797
Show file tree
Hide file tree
Showing 177 changed files with 1,009 additions and 768 deletions.
46 changes: 2 additions & 44 deletions src/sage/algebras/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,10 @@
#*****************************************************************************
from sage.misc.lazy_import import lazy_import

import sage.algebras.catalog as algebras
from .all__sagemath_modules import *
from .all__sagemath_combinat import *

from .quatalg.all import *
from .steenrod.all import *
from .fusion_rings.all import *
from .lie_algebras.all import *
from .quantum_groups.all import *
from .lie_conformal_algebras.all import *

# Algebra base classes
from .algebra import Algebra
from .free_algebra import FreeAlgebra
from .free_algebra_quotient import FreeAlgebraQuotient


from .finite_dimensional_algebras.all import FiniteDimensionalAlgebra

lazy_import('sage.algebras.group_algebra', 'GroupAlgebra')

lazy_import('sage.algebras.iwahori_hecke_algebra', 'IwahoriHeckeAlgebra')
lazy_import('sage.algebras.affine_nil_temperley_lieb',
'AffineNilTemperleyLiebTypeA')
lazy_import('sage.algebras.nil_coxeter_algebra', 'NilCoxeterAlgebra')
lazy_import('sage.algebras.schur_algebra', ['SchurAlgebra',
'SchurTensorModule'])

lazy_import('sage.algebras.hall_algebra', 'HallAlgebra')

lazy_import('sage.algebras.jordan_algebra', 'JordanAlgebra')

lazy_import('sage.algebras.octonion_algebra', 'OctonionAlgebra')

lazy_import('sage.algebras.shuffle_algebra', 'ShuffleAlgebra')

from .clifford_algebra import CliffordAlgebra, ExteriorAlgebra
from .weyl_algebra import DifferentialWeylAlgebra

lazy_import('sage.algebras.commutative_dga', 'GradedCommutativeAlgebra')

lazy_import('sage.algebras.rational_cherednik_algebra',
'RationalCherednikAlgebra')

lazy_import('sage.algebras.tensor_algebra', 'TensorAlgebra')

lazy_import('sage.algebras.q_system', 'QSystem')

lazy_import('sage.algebras.cluster_algebra', 'ClusterAlgebra')

lazy_import('sage.algebras.yangian', 'Yangian')
35 changes: 35 additions & 0 deletions src/sage/algebras/all__sagemath_combinat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from sage.misc.lazy_import import lazy_import


# Algebra base classes
lazy_import('sage.algebras.free_algebra', 'FreeAlgebra')
lazy_import('sage.algebras.free_algebra_quotient', 'FreeAlgebraQuotient')

from .steenrod.all import *
from .quantum_groups.all import *

lazy_import('sage.algebras.iwahori_hecke_algebra', 'IwahoriHeckeAlgebra')
lazy_import('sage.algebras.affine_nil_temperley_lieb',
'AffineNilTemperleyLiebTypeA')
lazy_import('sage.algebras.nil_coxeter_algebra', 'NilCoxeterAlgebra')
lazy_import('sage.algebras.schur_algebra', ['SchurAlgebra',
'SchurTensorModule'])

lazy_import('sage.algebras.hall_algebra', 'HallAlgebra')

lazy_import('sage.algebras.jordan_algebra', 'JordanAlgebra')

lazy_import('sage.algebras.shuffle_algebra', 'ShuffleAlgebra')

lazy_import('sage.algebras.commutative_dga', 'GradedCommutativeAlgebra')

lazy_import('sage.algebras.rational_cherednik_algebra',
'RationalCherednikAlgebra')

lazy_import('sage.algebras.tensor_algebra', 'TensorAlgebra')

lazy_import('sage.algebras.q_system', 'QSystem')

lazy_import('sage.algebras.cluster_algebra', 'ClusterAlgebra')

lazy_import('sage.algebras.yangian', 'Yangian')
11 changes: 11 additions & 0 deletions src/sage/algebras/all__sagemath_modules.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from sage.misc.lazy_import import lazy_import

lazy_import('sage.algebras.group_algebra', 'GroupAlgebra')

from .algebra import Algebra
from .finite_dimensional_algebras.all import FiniteDimensionalAlgebra
from .clifford_algebra import CliffordAlgebra, ExteriorAlgebra
from .weyl_algebra import DifferentialWeylAlgebra
lazy_import('sage.algebras.octonion_algebra', 'OctonionAlgebra')

import sage.algebras.catalog as algebras
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion src/sage/algebras/steenrod/all.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
The Steenrod algebra
"""
from .steenrod_algebra import SteenrodAlgebra, Sq
from sage.misc.lazy_import import lazy_import
lazy_import('sage.algebras.steenrod.steenrod_algebra', ['SteenrodAlgebra', 'Sq'])
lazy_import('sage.algebras.steenrod.steenrod_algebra_bases',
'steenrod_algebra_basis',
deprecation=(32647, 'removed from namespace'))
2 changes: 2 additions & 0 deletions src/sage/arith/all__sagemath_objects.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# The presence of this file ensures that sage_setup for sagemath-objects
# considers this directory as a namespace package

from sage.arith.power import generic_power as power
35 changes: 9 additions & 26 deletions src/sage/calculus/all.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
from .all__sagemath_modules import *

from sage.misc.lazy_import import lazy_import

from .calculus import maxima as maxima_calculus
from .calculus import (laplace, inverse_laplace,
limit, lim)

from .integration import numerical_integral, monte_carlo_integral
integral_numerical = numerical_integral

from .interpolation import spline, Spline

from .functional import (diff, derivative,
expand,
taylor, simplify)

from .functions import (wronskian, jacobian)

from .ode import ode_solver, ode_system

from .desolvers import (desolve, desolve_laplace, desolve_system,
eulers_method, eulers_method_2x2,
eulers_method_2x2_plot, desolve_rk4, desolve_system_rk4,
desolve_odeint, desolve_mintides, desolve_tides_mpfr)

from .var import (var, function, clear_vars)

from .transforms.all import *

# We lazy_import the following modules since they import numpy which slows down sage startup
from sage.misc.lazy_import import lazy_import
lazy_import("sage.calculus.riemann", ["Riemann_Map"])
lazy_import("sage.calculus.interpolators", ["polygon_spline", "complex_cubic_spline"])

from sage.modules.free_module_element import vector
from sage.matrix.constructor import matrix
lazy_import('sage.modules.free_module_element', ['vector', 'FreeModuleElement'])
lazy_import('sage.matrix.constructor', 'matrix')


def symbolic_expression(x):
Expand Down Expand Up @@ -68,6 +51,7 @@ def symbolic_expression(x):
Note that equations exist in the symbolic ring::
sage: # needs sage.schemes
sage: E = EllipticCurve('15a'); E
Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 - 10*x - 10 over Rational Field
sage: symbolic_expression(E)
Expand Down Expand Up @@ -188,21 +172,20 @@ def symbolic_expression(x):
TypeError: unable to convert <function function_with_keyword_only_arg at 0x...>
to a symbolic expression
"""
from sage.structure.element import is_Matrix
from sage.symbolic.expression import Expression
from sage.symbolic.ring import SR
from sage.modules.free_module_element import is_FreeModuleElement
from sage.structure.element import is_Matrix

if isinstance(x, Expression):
return x
elif hasattr(x, '_symbolic_'):
return x._symbolic_(SR)
elif isinstance(x, (tuple, list)) or is_FreeModuleElement(x):
elif isinstance(x, (tuple, list, FreeModuleElement)):
expressions = [symbolic_expression(item) for item in x]
if not expressions:
# Make sure it is symbolic also when length is 0
return vector(SR, 0)
if is_FreeModuleElement(expressions[0]):
if isinstance(expressions[0], FreeModuleElement):
return matrix(expressions)
return vector(expressions)
elif is_Matrix(x):
Expand Down
1 change: 1 addition & 0 deletions src/sage/calculus/all__sagemath_categories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .functional import diff, derivative, expand, simplify, taylor
17 changes: 17 additions & 0 deletions src/sage/calculus/all__sagemath_modules.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from .all__sagemath_categories import *

from .integration import numerical_integral, monte_carlo_integral
integral_numerical = numerical_integral

from .interpolation import spline, Spline

from .functions import wronskian, jacobian

from .ode import ode_solver, ode_system

# We lazy_import the following modules since they import numpy which slows down sage startup
from sage.misc.lazy_import import lazy_import
lazy_import("sage.calculus.riemann", ["Riemann_Map"])
lazy_import("sage.calculus.interpolators", ["polygon_spline","complex_cubic_spline"])

from .transforms.all import *
Empty file.
Empty file.
Loading

0 comments on commit 79b1797

Please sign in to comment.