From 2c6dd8318bf7583fb8186c9ac1ba207e15661fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20R=C3=BCth?= Date: Sun, 14 Apr 2024 22:38:09 +0300 Subject: [PATCH] Fixup changes to reestablish #36676 The chain of immediate ancestors of this commit was created by cherry-picking the relevant commits that comprise #36676. Replaying all these commits (and the necessary conflict resolution) still leaves a non-empty diff when comparing 10.4.beta2 to the previous #36676 and 10.4.beta3 to that cherry-picked branch. This commit makes sure that the diff is trivial. The changes introduced here were likely introduced in conflict resolution when merging develop into #36676. I did not replay these conflict resolutions, so I do this here manually. --- src/sage/algebras/all.py | 2 +- src/sage/algebras/all__sagemath_modules.py | 4 +- src/sage/all__sage_categories.py | 5 --- src/sage/arith/all.py | 2 - src/sage/categories/all.py | 4 +- src/sage/combinat/all__sagemath_combinat.py | 4 +- src/sage/groups/all__sagemath_categories.py | 2 +- src/sage/knots/all.py | 4 +- src/sage/libs/all__sagemath_flint.py | 2 +- src/sage/misc/all__sagemath_categories.py | 3 -- src/sage/misc/sageinspect.py | 6 ++- src/sage/modules/all.py | 15 +++++-- .../quadratic_forms/all__sagemath_pari.py | 1 + src/sage/rings/all.py | 20 +++++---- src/sage/rings/all__sage_categories.py | 6 --- src/sage/rings/all__sagemath_categories.py | 4 +- src/sage/rings/ideal.py | 4 +- src/sage/schemes/elliptic_curves/all.py | 4 ++ src/sage/schemes/hyperelliptic_curves/all.py | 42 ------------------- src/sage/stats/all.py | 1 + 20 files changed, 47 insertions(+), 88 deletions(-) delete mode 100644 src/sage/all__sage_categories.py delete mode 100644 src/sage/rings/all__sage_categories.py diff --git a/src/sage/algebras/all.py b/src/sage/algebras/all.py index e27ec576cc2..ebeec786100 100644 --- a/src/sage/algebras/all.py +++ b/src/sage/algebras/all.py @@ -14,7 +14,7 @@ # The full text of the GPL is available at: # # https://www.gnu.org/licenses/ -# **************************************************************************** +# ***************************************************************************** from sage.algebras.all__sagemath_modules import * from sage.algebras.all__sagemath_combinat import * diff --git a/src/sage/algebras/all__sagemath_modules.py b/src/sage/algebras/all__sagemath_modules.py index 3917d3c2fff..fc74dabe241 100644 --- a/src/sage/algebras/all__sagemath_modules.py +++ b/src/sage/algebras/all__sagemath_modules.py @@ -2,7 +2,9 @@ lazy_import('sage.algebras.group_algebra', 'GroupAlgebra') -from sage.algebras.algebra import Algebra +# old-style class for associative algebras, use Parent instead +from sage.rings.ring 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 diff --git a/src/sage/all__sage_categories.py b/src/sage/all__sage_categories.py deleted file mode 100644 index 9aba871b139..00000000000 --- a/src/sage/all__sage_categories.py +++ /dev/null @@ -1,5 +0,0 @@ -from .all__sage_objects import * - -from sage.categories.all import * - -from sage.rings.all__sage_categories import * diff --git a/src/sage/arith/all.py b/src/sage/arith/all.py index 7bc6ccec7f6..c7bcd7224f6 100644 --- a/src/sage/arith/all.py +++ b/src/sage/arith/all.py @@ -26,8 +26,6 @@ lazy_import("sage.arith.misc", ("Sigma", "Moebius", "Euler_Phi"), deprecation=30322) -from sage.arith.functions import lcm - from sage.arith.functions import lcm LCM = lcm diff --git a/src/sage/categories/all.py b/src/sage/categories/all.py index a0e1ce94577..09933cca7c2 100644 --- a/src/sage/categories/all.py +++ b/src/sage/categories/all.py @@ -81,7 +81,7 @@ RingModules = Modules from sage.categories.vector_spaces import VectorSpaces -# (hopf) algebra structures +# (Hopf) algebra structures from sage.categories.algebras import Algebras from sage.categories.commutative_algebras import CommutativeAlgebras from sage.categories.coalgebras import Coalgebras @@ -104,7 +104,7 @@ # schemes and varieties from sage.categories.modular_abelian_varieties import ModularAbelianVarieties -from sage.categories.schemes import Schemes +from sage.categories.schemes import Schemes, AbelianVarieties # * with basis from sage.categories.modules_with_basis import ModulesWithBasis diff --git a/src/sage/combinat/all__sagemath_combinat.py b/src/sage/combinat/all__sagemath_combinat.py index 82936a0c106..7968f3fde4a 100644 --- a/src/sage/combinat/all__sagemath_combinat.py +++ b/src/sage/combinat/all__sagemath_combinat.py @@ -148,7 +148,7 @@ lazy_import('sage.combinat.integer_vectors_mod_permgroup', 'IntegerVectorsModPermutationGroup') -lazy_import('sage.combinat.q_analogues', ['gaussian_binomial', 'q_binomial']) +lazy_import('sage.combinat.q_analogues', ['gaussian_binomial', 'q_binomial', 'number_of_irreducible_polynomials']) from sage.combinat.species.all import * @@ -174,8 +174,6 @@ lazy_import('sage.combinat.recognizable_series', 'RecognizableSeriesSpace') lazy_import('sage.combinat.regular_sequence', 'RegularSequenceRing') - - # Six Vertex Model lazy_import('sage.combinat.six_vertex_model', 'SixVertexModel') diff --git a/src/sage/groups/all__sagemath_categories.py b/src/sage/groups/all__sagemath_categories.py index 18f110bd599..cf28b7d6bff 100644 --- a/src/sage/groups/all__sagemath_categories.py +++ b/src/sage/groups/all__sagemath_categories.py @@ -1,7 +1,7 @@ from sage.groups.all__sagemath_objects import * from sage.groups.generic import (discrete_log, discrete_log_rho, discrete_log_lambda, - linear_relation, multiple, multiples) + linear_relation, multiple, multiples, order_from_multiple) from sage.misc.lazy_import import lazy_import diff --git a/src/sage/knots/all.py b/src/sage/knots/all.py index db3eb42aa2f..d25acbda1a3 100644 --- a/src/sage/knots/all.py +++ b/src/sage/knots/all.py @@ -3,6 +3,4 @@ lazy_import('sage.knots.knot', ['Knot', 'Knots']) lazy_import('sage.knots.link', 'Link') -if DatabaseKnotInfo().is_present(): - lazy_import('sage.knots.knotinfo', ['KnotInfo', 'KnotInfoSeries']) -del lazy_import +lazy_import('sage.knots.knotinfo', ['KnotInfo', 'KnotInfoSeries']) diff --git a/src/sage/libs/all__sagemath_flint.py b/src/sage/libs/all__sagemath_flint.py index d4ee16d7779..b5e330d8329 100644 --- a/src/sage/libs/all__sagemath_flint.py +++ b/src/sage/libs/all__sagemath_flint.py @@ -11,6 +11,6 @@ from sage.misc.lazy_import import lazy_import -lazy_import('sage.libs.flint.qsieve', 'qsieve') +lazy_import('sage.libs.flint.qsieve_sage', 'qsieve') del lazy_import diff --git a/src/sage/misc/all__sagemath_categories.py b/src/sage/misc/all__sagemath_categories.py index 46be65b787c..0806bdf7aec 100644 --- a/src/sage/misc/all__sagemath_categories.py +++ b/src/sage/misc/all__sagemath_categories.py @@ -41,10 +41,7 @@ integral_closure, interval, xinterval, - is_commutative, is_even, - is_integrally_closed, - is_field, is_odd, kernel, krull_dimension, diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py index c69635ddf34..7b1e8e1db18 100644 --- a/src/sage/misc/sageinspect.py +++ b/src/sage/misc/sageinspect.py @@ -2267,8 +2267,10 @@ def sage_getsourcelines(obj): EXAMPLES:: sage: from sage.misc.sageinspect import sage_getsourcelines - sage: from sage.matrix.constructor import matrix # needs sage.modules - sage: sage_getsourcelines(matrix)[1] # needs sage.modules + + sage: # needs sage.modules + sage: from sage.matrix.constructor import matrix + sage: sage_getsourcelines(matrix)[1] 21 sage: sage_getsourcelines(matrix)[0][0] 'def matrix(*args, **kwds):\n' diff --git a/src/sage/modules/all.py b/src/sage/modules/all.py index a75814718b6..955a2c72d4c 100644 --- a/src/sage/modules/all.py +++ b/src/sage/modules/all.py @@ -15,11 +15,18 @@ from sage.modules.free_module import FreeModule, VectorSpace, span -from sage.modules.free_quadratic_module import (FreeQuadraticModule, QuadraticSpace, - InnerProductSpace) +from sage.modules.free_quadratic_module import ( + FreeQuadraticModule, + QuadraticSpace, + InnerProductSpace, +) -from sage.modules.free_module_element import (vector, free_module_element, zero_vector, - random_vector) +from sage.modules.free_module_element import ( + vector, + free_module_element, + zero_vector, + random_vector, +) from sage.modules.vector_space_morphism import linear_transformation diff --git a/src/sage/quadratic_forms/all__sagemath_pari.py b/src/sage/quadratic_forms/all__sagemath_pari.py index 3217ed8cd0a..f6235960f54 100644 --- a/src/sage/quadratic_forms/all__sagemath_pari.py +++ b/src/sage/quadratic_forms/all__sagemath_pari.py @@ -1,3 +1,4 @@ +from sage.quadratic_forms.bqf_class_group import BQFClassGroup from sage.quadratic_forms.special_values import (gamma__exact, zeta__exact, QuadraticBernoulliNumber, quadratic_L_function__exact, quadratic_L_function__numerical) diff --git a/src/sage/rings/all.py b/src/sage/rings/all.py index 1e3eecdb5e5..965f83d02f6 100644 --- a/src/sage/rings/all.py +++ b/src/sage/rings/all.py @@ -12,15 +12,7 @@ # **************************************************************************** from sage.misc.lazy_import import lazy_import -from sage.rings.all__sagemath_combinat import * -from sage.rings.all__sagemath_flint import * -from sage.rings.all__sagemath_gap import * -from sage.rings.all__sagemath_modules import * - -try: - from sage.rings.all__sagemath_symbolics import * -except ImportError: - pass +from sage.rings.all__sagemath_categories import * # Following will go to all__sagemath_categories.py in #36566 @@ -50,6 +42,16 @@ # Finite fields from sage.rings.finite_rings.all import * +from sage.rings.all__sagemath_combinat import * +from sage.rings.all__sagemath_flint import * +from sage.rings.all__sagemath_gap import * +from sage.rings.all__sagemath_modules import * + +try: + from sage.rings.all__sagemath_symbolics import * +except ImportError: + pass + # Function field from sage.rings.function_field.all import * diff --git a/src/sage/rings/all__sage_categories.py b/src/sage/rings/all__sage_categories.py deleted file mode 100644 index 8d14e7afcda..00000000000 --- a/src/sage/rings/all__sage_categories.py +++ /dev/null @@ -1,6 +0,0 @@ -# Ring base classes -from .ring import Ring - -# Ideals -from .ideal import Ideal -ideal = Ideal diff --git a/src/sage/rings/all__sagemath_categories.py b/src/sage/rings/all__sagemath_categories.py index cd8b9cf6f01..d2fa0062d68 100644 --- a/src/sage/rings/all__sagemath_categories.py +++ b/src/sage/rings/all__sagemath_categories.py @@ -2,7 +2,9 @@ # Ring base classes from sage.rings.ring import (Ring, Field, CommutativeRing, IntegralDomain, - DedekindDomain, PrincipalIdealDomain, EuclideanDomain) + PrincipalIdealDomain) + +lazy_import("sage.rings.ring", "DedekindDomain") # Ring element base classes from sage.structure.element import (CommutativeAlgebraElement, diff --git a/src/sage/rings/ideal.py b/src/sage/rings/ideal.py index a656aa309b7..4dba8ec9d42 100644 --- a/src/sage/rings/ideal.py +++ b/src/sage/rings/ideal.py @@ -28,7 +28,8 @@ from types import GeneratorType -import sage.rings.ring +from sage.categories.rings import Rings +from sage.categories.fields import Fields from sage.structure.element import MonoidElement from sage.structure.richcmp import rich_to_bool, richcmp from sage.structure.sequence import Sequence @@ -1862,7 +1863,6 @@ def FieldIdeal(R): over Finite Field in alpha of size 2^4 """ q = R.base_ring().order() - import sage.rings.infinity if q is sage.rings.infinity.infinity: raise TypeError("Cannot construct field ideal for R.base_ring().order()==infinity") diff --git a/src/sage/schemes/elliptic_curves/all.py b/src/sage/schemes/elliptic_curves/all.py index 0701ab54a00..84f7b0d5a50 100644 --- a/src/sage/schemes/elliptic_curves/all.py +++ b/src/sage/schemes/elliptic_curves/all.py @@ -26,6 +26,8 @@ from sage.misc.lazy_import import lazy_import lazy_import('sage.schemes.elliptic_curves.jacobian', 'Jacobian') +lazy_import('sage.schemes.elliptic_curves.ell_finite_field', 'special_supersingular_curve') + lazy_import('sage.schemes.elliptic_curves.ell_rational_field', ['cremona_curves', 'cremona_optimal_curves']) @@ -40,5 +42,7 @@ from sage.schemes.elliptic_curves.ell_curve_isogeny import EllipticCurveIsogeny, isogeny_codomain_from_kernel +lazy_import('sage.schemes.elliptic_curves.mod_poly', 'classical_modular_polynomial') + from sage.schemes.elliptic_curves.heegner import heegner_points, heegner_point del lazy_import diff --git a/src/sage/schemes/hyperelliptic_curves/all.py b/src/sage/schemes/hyperelliptic_curves/all.py index 40c8b58e823..044c97cd498 100644 --- a/src/sage/schemes/hyperelliptic_curves/all.py +++ b/src/sage/schemes/hyperelliptic_curves/all.py @@ -1,47 +1,5 @@ -""" -Tests for deprecations of imports in global namespace from :trac:`28064`:: - - sage: igusa_clebsch_invariants - doctest:warning...: - DeprecationWarning: - Importing igusa_clebsch_invariants from here is deprecated; - please use "from sage.schemes.hyperelliptic_curves.invariants import igusa_clebsch_invariants" instead. - See https://github.com/sagemath/sage/issues/28064 for details. - ... - - sage: absolute_igusa_invariants_kohel - doctest:warning...: - DeprecationWarning: - Importing absolute_igusa_invariants_kohel from here is deprecated; - please use "from sage.schemes.hyperelliptic_curves.invariants import absolute_igusa_invariants_kohel" instead. - See https://github.com/sagemath/sage/issues/28064 for details. - ... - - sage: absolute_igusa_invariants_wamelen - doctest:warning...: - DeprecationWarning: - Importing absolute_igusa_invariants_wamelen from here is deprecated; - please use "from sage.schemes.hyperelliptic_curves.invariants import absolute_igusa_invariants_wamelen" instead. - See https://github.com/sagemath/sage/issues/28064 for details. - ... - - sage: clebsch_invariants - doctest:warning...: - DeprecationWarning: - Importing clebsch_invariants from here is deprecated; - please use "from sage.schemes.hyperelliptic_curves.invariants import clebsch_invariants" instead. - See https://github.com/sagemath/sage/issues/28064 for details. - ... -""" -from sage.misc.lazy_import import lazy_import - from sage.schemes.hyperelliptic_curves.constructor import HyperellipticCurve from sage.schemes.hyperelliptic_curves.kummer_surface import KummerSurface -lazy_import('sage.schemes.hyperelliptic_curves.invariants', - ['igusa_clebsch_invariants', 'absolute_igusa_invariants_kohel', - 'absolute_igusa_invariants_wamelen', 'clebsch_invariants'], - deprecation=28064) from sage.schemes.hyperelliptic_curves.mestre import ( Mestre_conic, HyperellipticCurve_from_invariants) from sage.schemes.hyperelliptic_curves import monsky_washnitzer -del lazy_import diff --git a/src/sage/stats/all.py b/src/sage/stats/all.py index 450991bd576..56d9f2eb1e8 100644 --- a/src/sage/stats/all.py +++ b/src/sage/stats/all.py @@ -1,5 +1,6 @@ from sage.stats.basic_stats import (mean, mode, std, variance, median, moving_average) from sage.stats.hmm import all as hmm +import sage.stats.distributions.catalog as distributions from sage.misc.lazy_import import lazy_import