forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-36676: Restructure
sage.*.all
for modularization, replac…
…e relative by absolute imports <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> We restructure the `all.py` files for modularization. Guided by the technical constraints outlined in https://groups.google.com/g/sage-devel/c/ozh-7ZZ848s, sagemath#35095 defines distribution packages (pip-installable packages) **sagemath-{brial, combinat, eclib, flint, gap, giac, glpk, graphs, groups, homfly, lcalc, libbraiding, libecm, linbox, modules, mpmath, ntl, pari, plot, polyhedra, schemes, singular, standard-no-symbolics, symbolics}**. When a namespace package such as `sage.misc` is filled by modules from several distribution packages, we create modules named: - `src/sage/misc/all__sagemath_environment.py` - `src/sage/misc/all__sagemath_objects.py` - `src/sage/misc/all__sagemath_repl.py` Import statements are moved from `src/sage/misc/all.py` to these files as appropriate, and `src/sage/misc/all.py` imports `*` from there. Also some imports are replaced by lazy imports. The new files provide the top level namespaces for the modularized distribution packages, thus [enabling modularized testing](https://doc.s agemath.org/html/en/developer/packaging_sage_library.html#testing- distribution-packages). This design was introduced in sagemath#29865 (merged in Jan 2022, early in the Sage 9.6 development cycle). <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> - Copied from sagemath#35095. - Part of sagemath#29705 Moreover, applied a one-line command to replace relative by absolute imports, thus complementing sagemath#36666, which does not touch `.all*` files. The changes to other files in `sage.modules` etc. come from the PRs sagemath#36597, sagemath#36572, sagemath#36588, sagemath#36589 merged here and do not need review. <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> - Depends on sagemath#36597 (merged here to resolve merge conflict) - Depends on sagemath#36572 (merged here to resolve merge conflict) - Depends on sagemath#36588 (merged here to resolve merge conflict) - Depends on sagemath#36589 (merged here to resolve merge conflict) - Depends on sagemath#36449 (merged here to resolve merge conflict) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36676 Reported by: Matthias Köppe Reviewer(s): David Coudert, John H. Palmieri, Matthias Köppe, Tobias Diez
- Loading branch information
Showing
293 changed files
with
1,990 additions
and
1,643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from sage.misc.lazy_import import lazy_import | ||
|
||
|
||
# Algebra base classes | ||
from sage.algebras.free_algebra import FreeAlgebra | ||
from sage.algebras.free_algebra_quotient import FreeAlgebraQuotient | ||
|
||
from sage.algebras.steenrod.all import * | ||
from sage.algebras.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') | ||
|
||
del lazy_import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from sage.misc.lazy_import import lazy_import | ||
|
||
lazy_import('sage.algebras.group_algebra', 'GroupAlgebra') | ||
|
||
from sage.algebras.algebra import Algebra | ||
from sage.algebras.finite_dimensional_algebras.all import FiniteDimensionalAlgebra | ||
from sage.algebras.clifford_algebra import CliffordAlgebra, ExteriorAlgebra | ||
from sage.algebras.weyl_algebra import DifferentialWeylAlgebra | ||
lazy_import('sage.algebras.octonion_algebra', 'OctonionAlgebra') | ||
|
||
import sage.algebras.catalog as algebras | ||
del lazy_import |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .finite_dimensional_algebra import FiniteDimensionalAlgebra | ||
from sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra import FiniteDimensionalAlgebra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
""" | ||
Hecke Algebras | ||
""" | ||
#from sage.misc.lazy_import import lazy_import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
#****************************************************************************** | ||
# ****************************************************************************** | ||
# Copyright (C) 2020 Reimundo Heluani <heluani@potuz.net> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# http://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
# https://www.gnu.org/licenses/ | ||
# ***************************************************************************** | ||
|
||
|
||
from sage.misc.lazy_import import lazy_import | ||
lazy_import('sage.algebras.lie_conformal_algebras.lie_conformal_algebra','LieConformalAlgebra') | ||
lazy_import('sage.algebras.lie_conformal_algebras', 'examples', 'lie_conformal_algebras') | ||
lazy_import('sage.algebras.lie_conformal_algebras.lie_conformal_algebra', | ||
'LieConformalAlgebra') | ||
lazy_import('sage.algebras.lie_conformal_algebras', | ||
'examples', 'lie_conformal_algebras') | ||
del lazy_import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .quaternion_algebra import QuaternionAlgebra | ||
from sage.algebras.quatalg.quaternion_algebra import QuaternionAlgebra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
""" | ||
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')) | ||
del lazy_import |
Oops, something went wrong.